Johan Hedberg | b105277 | 2011-06-28 23:32:53 +0300 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * OBEX library with GLib integration |
| 4 | * |
| 5 | * Copyright (C) 2011 Intel Corporation. All rights reserved. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
Johan Hedberg | 30e2aaa | 2013-02-15 16:25:24 +0200 | [diff] [blame] | 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
Johan Hedberg | b105277 | 2011-06-28 23:32:53 +0300 | [diff] [blame] | 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | #ifndef __GOBEX_DEFS_H |
| 24 | #define __GOBEX_DEFS_H |
| 25 | |
Johan Hedberg | aa1b87b | 2011-06-29 13:15:05 +0300 | [diff] [blame] | 26 | #include <glib.h> |
| 27 | |
Johan Hedberg | b105277 | 2011-06-28 23:32:53 +0300 | [diff] [blame] | 28 | typedef enum { |
| 29 | G_OBEX_DATA_INHERIT, |
| 30 | G_OBEX_DATA_COPY, |
| 31 | G_OBEX_DATA_REF, |
| 32 | } GObexDataPolicy; |
| 33 | |
Johan Hedberg | f059809 | 2011-07-12 01:51:37 +0300 | [diff] [blame] | 34 | #define G_OBEX_ERROR_FIRST (0xff + 1) |
| 35 | #define G_OBEX_PROTO_ERROR(code) ((code) < G_OBEX_ERROR_FIRST) |
| 36 | |
Johan Hedberg | aa1b87b | 2011-06-29 13:15:05 +0300 | [diff] [blame] | 37 | typedef enum { |
Johan Hedberg | f059809 | 2011-07-12 01:51:37 +0300 | [diff] [blame] | 38 | G_OBEX_ERROR_PARSE_ERROR = G_OBEX_ERROR_FIRST, |
Johan Hedberg | aa1b87b | 2011-06-29 13:15:05 +0300 | [diff] [blame] | 39 | G_OBEX_ERROR_INVALID_ARGS, |
Johan Hedberg | 0f10ac2 | 2011-06-29 14:33:04 +0300 | [diff] [blame] | 40 | G_OBEX_ERROR_DISCONNECTED, |
Johan Hedberg | 9292a83 | 2011-06-29 18:30:18 +0300 | [diff] [blame] | 41 | G_OBEX_ERROR_TIMEOUT, |
Johan Hedberg | 13d42a0 | 2011-06-30 00:26:19 +0300 | [diff] [blame] | 42 | G_OBEX_ERROR_CANCELLED, |
Johan Hedberg | 371bd8a | 2011-06-29 21:23:14 +0300 | [diff] [blame] | 43 | G_OBEX_ERROR_FAILED, |
Johan Hedberg | aa1b87b | 2011-06-29 13:15:05 +0300 | [diff] [blame] | 44 | } GObexError; |
| 45 | |
Johan Hedberg | b50f20a | 2011-07-05 19:36:41 +0300 | [diff] [blame] | 46 | typedef gssize (*GObexDataProducer) (void *buf, gsize len, gpointer user_data); |
| 47 | typedef gboolean (*GObexDataConsumer) (const void *buf, gsize len, |
| 48 | gpointer user_data); |
| 49 | |
Johan Hedberg | aa1b87b | 2011-06-29 13:15:05 +0300 | [diff] [blame] | 50 | #define G_OBEX_ERROR g_obex_error_quark() |
| 51 | GQuark g_obex_error_quark(void); |
| 52 | |
Johan Hedberg | b105277 | 2011-06-28 23:32:53 +0300 | [diff] [blame] | 53 | #endif /* __GOBEX_DEFS_H */ |