blob: 326e3cb09ab1059572afc968464fef9c8bfb8577 [file] [log] [blame]
Johan Hedbergb1052772011-06-28 23:32:53 +03001/*
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 Hedberg30e2aaa2013-02-15 16:25:24 +02008 * 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 Hedbergb1052772011-06-28 23:32:53 +030011 *
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 Hedbergaa1b87b2011-06-29 13:15:05 +030026#include <glib.h>
27
Johan Hedbergb1052772011-06-28 23:32:53 +030028typedef enum {
29 G_OBEX_DATA_INHERIT,
30 G_OBEX_DATA_COPY,
31 G_OBEX_DATA_REF,
32} GObexDataPolicy;
33
Johan Hedbergf0598092011-07-12 01:51:37 +030034#define G_OBEX_ERROR_FIRST (0xff + 1)
35#define G_OBEX_PROTO_ERROR(code) ((code) < G_OBEX_ERROR_FIRST)
36
Johan Hedbergaa1b87b2011-06-29 13:15:05 +030037typedef enum {
Johan Hedbergf0598092011-07-12 01:51:37 +030038 G_OBEX_ERROR_PARSE_ERROR = G_OBEX_ERROR_FIRST,
Johan Hedbergaa1b87b2011-06-29 13:15:05 +030039 G_OBEX_ERROR_INVALID_ARGS,
Johan Hedberg0f10ac22011-06-29 14:33:04 +030040 G_OBEX_ERROR_DISCONNECTED,
Johan Hedberg9292a832011-06-29 18:30:18 +030041 G_OBEX_ERROR_TIMEOUT,
Johan Hedberg13d42a02011-06-30 00:26:19 +030042 G_OBEX_ERROR_CANCELLED,
Johan Hedberg371bd8a2011-06-29 21:23:14 +030043 G_OBEX_ERROR_FAILED,
Johan Hedbergaa1b87b2011-06-29 13:15:05 +030044} GObexError;
45
Johan Hedbergb50f20a2011-07-05 19:36:41 +030046typedef gssize (*GObexDataProducer) (void *buf, gsize len, gpointer user_data);
47typedef gboolean (*GObexDataConsumer) (const void *buf, gsize len,
48 gpointer user_data);
49
Johan Hedbergaa1b87b2011-06-29 13:15:05 +030050#define G_OBEX_ERROR g_obex_error_quark()
51GQuark g_obex_error_quark(void);
52
Johan Hedbergb1052772011-06-28 23:32:53 +030053#endif /* __GOBEX_DEFS_H */