summaryrefslogtreecommitdiffstats
path: root/common/btio.h
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-02-16 19:48:54 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2009-02-16 19:48:54 +0200
commitd1f188d4b3822b9ac2bc333f1cb47b54536f6843 (patch)
tree5b8ba9e20f3f4d4b971d2bc8a7b7776a5f2525cd /common/btio.h
parent820e5e15ced0fff0e3e70a5b3e8270809a3fc422 (diff)
Convert BtIO API to use GError
Diffstat (limited to 'common/btio.h')
-rw-r--r--common/btio.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/common/btio.h b/common/btio.h
index 834e8527..614a1632 100644
--- a/common/btio.h
+++ b/common/btio.h
@@ -27,6 +27,17 @@
#include <glib.h>
typedef enum {
+ BT_IO_ERROR_DISCONNECTED,
+ BT_IO_ERROR_CONNECT_FAILED,
+ BT_IO_ERROR_FAILED,
+ BT_IO_ERROR_INVALID_ARGS,
+} BtIOError;
+
+#define BT_IO_ERROR bt_io_error_quark()
+
+GQuark bt_io_error_quark(void);
+
+typedef enum {
BT_IO_L2RAW,
BT_IO_L2CAP,
BT_IO_RFCOMM,
@@ -50,21 +61,24 @@ typedef enum {
typedef void (*BtIOConfirm)(GIOChannel *io, gpointer user_data);
-typedef void (*BtIOConnect)(GIOChannel *io, int err, gpointer user_data);
+typedef void (*BtIOConnect)(GIOChannel *io, GError *err, gpointer user_data);
gboolean bt_io_accept(GIOChannel *io, BtIOConnect connect, gpointer user_data,
- GDestroyNotify destroy);
+ GDestroyNotify destroy, GError **err);
-gboolean bt_io_set(GIOChannel *io, BtIOType type, BtIOOption opt1, ...);
+gboolean bt_io_set(GIOChannel *io, BtIOType type, GError **err,
+ BtIOOption opt1, ...);
-gboolean bt_io_get(GIOChannel *io, BtIOType type, BtIOOption opt1, ...);
+gboolean bt_io_get(GIOChannel *io, BtIOType type, GError **err,
+ BtIOOption opt1, ...);
GIOChannel *bt_io_connect(BtIOType type, BtIOConnect connect,
gpointer user_data, GDestroyNotify destroy,
- BtIOOption opt1, ...);
+ GError **err, BtIOOption opt1, ...);
GIOChannel *bt_io_listen(BtIOType type, BtIOConnect connect,
BtIOConfirm confirm, gpointer user_data,
- GDestroyNotify destroy, BtIOOption opt1, ...);
+ GDestroyNotify destroy, GError **err,
+ BtIOOption opt1, ...);
#endif