summaryrefslogtreecommitdiffstats
path: root/common/dbus-helper.h
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-05-08 20:23:45 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-05-08 20:23:45 +0000
commite7d668ac9e813bc9922ee7d771848bd8822d5d1f (patch)
tree34e2fc7b1c064beaa52e5e05e9278be458be9fba /common/dbus-helper.h
parent44a204a75880c342c3ac9066072f102f773a539a (diff)
Move D-Bus watch functions into libgdbus
Diffstat (limited to 'common/dbus-helper.h')
-rw-r--r--common/dbus-helper.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/common/dbus-helper.h b/common/dbus-helper.h
index 57c3d09b..6c3c3a89 100644
--- a/common/dbus-helper.h
+++ b/common/dbus-helper.h
@@ -20,8 +20,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
+
#include <stdarg.h>
-#include <dbus.h>
+#include <dbus/dbus.h>
#define DBUS_TYPE_STRING_ARRAY_AS_STRING (DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_STRING_AS_STRING)
#define DBUS_TYPE_BYTE_ARRAY_AS_STRING (DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_BYTE_AS_STRING)
@@ -93,3 +94,14 @@ dbus_bool_t dbus_connection_emit_property_changed(DBusConnection *conn,
const char *interface,
const char *name,
int type, void *value);
+
+static inline DBusHandlerResult send_message_and_unref(DBusConnection *conn,
+ DBusMessage *msg)
+{
+ if (msg) {
+ dbus_connection_send(conn, msg, NULL);
+ dbus_message_unref(msg);
+ }
+
+ return DBUS_HANDLER_RESULT_HANDLED;
+}