summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-06-07 16:22:47 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-06-07 16:22:47 +0000
commitf06919f22999bd132ae6d84191245387eae9d733 (patch)
treeb48cb7a2c184a5cdc0c64c0115c3ba4479a5f697 /gdbus
parentc910fb98d032261cc27c462d481d77674f13bded (diff)
downloadbluez-f06919f22999bd132ae6d84191245387eae9d733.tar.gz
Add proper signal sending helpers
Diffstat (limited to 'gdbus')
-rw-r--r--gdbus/gdbus.h13
-rw-r--r--gdbus/object.c30
2 files changed, 34 insertions, 9 deletions
diff --git a/gdbus/gdbus.h b/gdbus/gdbus.h
index 99f34a84b..0ec90dcb7 100644
--- a/gdbus/gdbus.h
+++ b/gdbus/gdbus.h
@@ -56,12 +56,6 @@ dbus_bool_t dbus_connection_emit_signal(DBusConnection *conn, const char *path,
const char *interface, const char *name,
int first, ...);
-dbus_bool_t dbus_connection_emit_signal_valist(DBusConnection *conn,
- const char *path,
- const char *interface,
- const char *name,
- int first,
- va_list var_args);
dbus_bool_t dbus_connection_emit_property_changed(DBusConnection *conn,
const char *path,
const char *interface,
@@ -133,6 +127,13 @@ gboolean g_dbus_send_reply(DBusConnection *connection,
gboolean g_dbus_send_reply_valist(DBusConnection *connection,
DBusMessage *message, int type, va_list args);
+gboolean g_dbus_emit_signal(DBusConnection *connection,
+ const char *path, const char *interface,
+ const char *name, int type, ...);
+gboolean g_dbus_emit_signal_valist(DBusConnection *connection,
+ const char *path, const char *interface,
+ const char *name, int type, va_list args);
+
guint g_dbus_add_disconnect_watch(DBusConnection *connection,
const char *name,
GDBusWatchFunction function,
diff --git a/gdbus/object.c b/gdbus/object.c
index fbcc8131c..dcda54897 100644
--- a/gdbus/object.c
+++ b/gdbus/object.c
@@ -522,7 +522,7 @@ static gboolean check_signal(DBusConnection *conn, const char *path,
return TRUE;
}
-dbus_bool_t dbus_connection_emit_signal_valist(DBusConnection *conn,
+static dbus_bool_t emit_signal_valist(DBusConnection *conn,
const char *path,
const char *interface,
const char *name,
@@ -570,8 +570,7 @@ dbus_bool_t dbus_connection_emit_signal(DBusConnection *conn, const char *path,
va_list var_args;
va_start(var_args, first);
- ret = dbus_connection_emit_signal_valist(conn, path, interface, name,
- first, var_args);
+ ret = emit_signal_valist(conn, path, interface, name, first, var_args);
va_end(var_args);
return ret;
@@ -800,3 +799,28 @@ gboolean g_dbus_send_reply(DBusConnection *connection,
return result;
}
+
+gboolean g_dbus_emit_signal(DBusConnection *connection,
+ const char *path, const char *interface,
+ const char *name, int type, ...)
+{
+ va_list args;
+ gboolean result;
+
+ va_start(args, type);
+
+ result = emit_signal_valist(connection, path, interface,
+ name, type, args);
+
+ va_end(args);
+
+ return result;
+}
+
+gboolean g_dbus_emit_signal_valist(DBusConnection *connection,
+ const char *path, const char *interface,
+ const char *name, int type, va_list args)
+{
+ return emit_signal_valist(connection, path, interface,
+ name, type, args);
+}