summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-03-27 09:59:49 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-03-27 09:59:49 +0000
commit0fb47243d42d7d945d78f468bc3c403ec79c2c2d (patch)
tree26d927cd870abe8865f6bead7de85347e98f6004
parent652fc04d9039e9e6805f9bc08126416bbf0b3559 (diff)
Provide additional D-Bus setup helper function
-rw-r--r--common/dbus.c15
-rw-r--r--common/dbus.h6
2 files changed, 15 insertions, 6 deletions
diff --git a/common/dbus.c b/common/dbus.c
index 6cf4b192..6a7eeb0f 100644
--- a/common/dbus.c
+++ b/common/dbus.c
@@ -483,7 +483,7 @@ static dbus_bool_t add_timeout(DBusTimeout *timeout, void *data)
{
timeout_handler_t *handler;
- if (!dbus_timeout_get_enabled (timeout))
+ if (!dbus_timeout_get_enabled(timeout))
return TRUE;
handler = g_new0(timeout_handler_t, 1);
@@ -499,7 +499,6 @@ static dbus_bool_t add_timeout(DBusTimeout *timeout, void *data)
static void remove_timeout(DBusTimeout *timeout, void *data)
{
-
}
static void timeout_toggled(DBusTimeout *timeout, void *data)
@@ -511,8 +510,7 @@ static void timeout_toggled(DBusTimeout *timeout, void *data)
}
static void dispatch_status_cb(DBusConnection *conn,
- DBusDispatchStatus new_status,
- void *data)
+ DBusDispatchStatus new_status, void *data)
{
if (!dbus_connection_get_is_connected(conn))
return;
@@ -522,7 +520,8 @@ static void dispatch_status_cb(DBusConnection *conn,
}
#endif
-DBusConnection *init_dbus(const char *name, void (*disconnect_cb)(void *), void *user_data)
+DBusConnection *init_dbus(const char *name,
+ void (*disconnect_cb)(void *), void *user_data)
{
struct disconnect_data *dc_data;
DBusConnection *conn;
@@ -590,6 +589,12 @@ DBusConnection *init_dbus(const char *name, void (*disconnect_cb)(void *), void
return conn;
}
+DBusConnection *dbus_bus_system_setup_with_main_loop(const char *name,
+ void (*disconnect_cb)(void *), void *user_data)
+{
+ return init_dbus(name, disconnect_cb, user_data);
+}
+
static char simple_xml[] = DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<node></node>";
DBusHandlerResult simple_introspect(DBusConnection *conn,
diff --git a/common/dbus.h b/common/dbus.h
index f2bf45af..4e4ed487 100644
--- a/common/dbus.h
+++ b/common/dbus.h
@@ -26,7 +26,11 @@
#include <dbus/dbus.h>
-DBusConnection *init_dbus(const char *name, void (*disconnect_cb)(void *), void *user_data);
+DBusConnection *init_dbus(const char *name,
+ void (*disconnect_cb)(void *), void *user_data);
+
+DBusConnection *dbus_bus_system_setup_with_main_loop(const char *name,
+ void (*disconnect_cb)(void *), void *user_data);
DBusHandlerResult simple_introspect(DBusConnection *conn,
DBusMessage *msg, void *user_data);