2 * @file dbus-bindings.h Purple DBUS Bindings
8 * Purple is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
28 #ifndef _PURPLE_DBUS_BINDINGS_H_
29 #define _PURPLE_DBUS_BINDINGS_H_
31 #include <dbus/dbus.h>
32 #include <dbus/dbus-glib-lowlevel.h>
39 gint
purple_dbus_pointer_to_id(gconstpointer node
);
40 gpointer
purple_dbus_id_to_pointer(gint id
, PurpleDBusType
*type
);
41 gint
purple_dbus_pointer_to_id_error(gconstpointer ptr
, DBusError
*error
);
42 gpointer
purple_dbus_id_to_pointer_error(gint id
, PurpleDBusType
*type
,
43 const char *typename
, DBusError
*error
);
45 #define NULLIFY(id) id = empty_to_null(id)
47 #define CHECK_ERROR(error) if (dbus_error_is_set(error)) return NULL;
49 #define PURPLE_DBUS_ID_TO_POINTER(ptr, id, type, error) \
51 ptr = (type*) purple_dbus_id_to_pointer_error \
52 (id, PURPLE_DBUS_TYPE(type), #type, error); \
57 #define PURPLE_DBUS_POINTER_TO_ID(id, ptr, error) \
59 id = purple_dbus_pointer_to_id_error(ptr,error); \
65 purple_dbus_message_get_args (DBusMessage
*message
,
70 purple_dbus_message_get_args_valist (DBusMessage
*message
,
76 purple_dbus_message_iter_get_args (DBusMessageIter
*iter
,
82 purple_dbus_message_iter_get_args_valist (DBusMessageIter
*iter
,
87 dbus_int32_t
* purple_dbusify_GList(GList
*list
, gboolean free_memory
,
89 dbus_int32_t
* purple_dbusify_GSList(GSList
*list
, gboolean free_memory
,
91 gpointer
* purple_GList_to_array(GList
*list
, gboolean free_memory
,
93 gpointer
* purple_GSList_to_array(GSList
*list
, gboolean free_memory
,
95 GHashTable
*purple_dbus_iter_hash_table(DBusMessageIter
*iter
, DBusError
*error
);
97 const char* empty_to_null(const char *str
);
98 const char* null_to_empty(const char *s
);
102 const char *parameters
;
103 DBusMessage
* (*handler
)(DBusMessage
*request
, DBusError
*error
);
106 void purple_dbus_register_bindings(void *handle
, PurpleDBusBinding
*bindings
);
108 DBusConnection
*purple_dbus_get_connection(void);