summaryrefslogtreecommitdiff
path: root/dbind
diff options
context:
space:
mode:
authorMark Doffman <mdoff@silver-wind.(none)>2008-12-18 11:53:42 +0000
committerMark Doffman <mdoff@silver-wind.(none)>2008-12-18 12:25:50 +0000
commit8ea015764f1509bf78b64065072a3de0d9a8abbe (patch)
tree4f88fe6b84186143ac49292621a8d77d6aedbfd8 /dbind
parent95ac4886d1b6649d54daffa7191be1b2bbaf2989 (diff)
downloadat-spi2-core-8ea015764f1509bf78b64065072a3de0d9a8abbe.tar.gz
2008-12-18 Mark Doffman <mark.doffman@codethink.co.uk>
* Makefile.am Move dbind to before droute folder. droute now depends on dbind library. * cspi/* Change to cspi to fit with interface changes to dbind made in previous commit. * dbind/* Addition of varargs reentrant method call. Used in cspi.
Diffstat (limited to 'dbind')
-rw-r--r--dbind/dbind.c82
-rw-r--r--dbind/dbind.h10
2 files changed, 62 insertions, 30 deletions
diff --git a/dbind/dbind.c b/dbind/dbind.c
index 2cdf5f78..0103b4b8 100644
--- a/dbind/dbind.c
+++ b/dbind/dbind.c
@@ -40,41 +40,21 @@ send_and_allow_reentry (DBusConnection *bus, DBusMessage *message, DBusError *er
return reply;
}
-/**
- * dbind_method_call_reentrant:
- *
- * @cnx: A D-Bus Connection used to make the method call.
- * @bus_name: The D-Bus bus name of the program where the method call should
- * be made.
- * @path: The D-Bus object path that should handle the method.
- * @interface: The D-Bus interface used to scope the method name.
- * @method: Method to be invoked.
- * @opt_error: D-Bus error.
- * @arg_types: Variable length arguments interleaving D-Bus argument types
- * and pointers to argument data.
- *
- * Makes a D-Bus method call using the supplied location data, method name and
- * argument data.This function is re-entrant. It continuously reads from the D-Bus
- * bus and dispatches messages until a reply has been recieved.
- **/
dbus_bool_t
-dbind_method_call_reentrant (DBusConnection *cnx,
- const char *bus_name,
- const char *path,
- const char *interface,
- const char *method,
- DBusError *opt_error,
- const char *arg_types,
- ...)
+dbind_method_call_reentrant_va (DBusConnection *cnx,
+ const char *bus_name,
+ const char *path,
+ const char *interface,
+ const char *method,
+ DBusError *opt_error,
+ const char *arg_types,
+ va_list args)
{
dbus_bool_t success = FALSE;
DBusMessage *msg = NULL, *reply = NULL;
DBusMessageIter iter;
DBusError *err, real_err;
char *p;
- va_list args;
-
- va_start (args, arg_types);
if (opt_error)
err = opt_error;
@@ -112,8 +92,6 @@ dbind_method_call_reentrant (DBusConnection *cnx,
success = TRUE;
out:
- va_end (args);
-
if (msg)
dbus_message_unref (msg);
@@ -126,6 +104,50 @@ out:
return success;
}
+/**
+ * dbind_method_call_reentrant:
+ *
+ * @cnx: A D-Bus Connection used to make the method call.
+ * @bus_name: The D-Bus bus name of the program where the method call should
+ * be made.
+ * @path: The D-Bus object path that should handle the method.
+ * @interface: The D-Bus interface used to scope the method name.
+ * @method: Method to be invoked.
+ * @opt_error: D-Bus error.
+ * @arg_types: Variable length arguments interleaving D-Bus argument types
+ * and pointers to argument data.
+ *
+ * Makes a D-Bus method call using the supplied location data, method name and
+ * argument data.This function is re-entrant. It continuously reads from the D-Bus
+ * bus and dispatches messages until a reply has been recieved.
+ **/
+dbus_bool_t
+dbind_method_call_reentrant (DBusConnection *cnx,
+ const char *bus_name,
+ const char *path,
+ const char *interface,
+ const char *method,
+ DBusError *opt_error,
+ const char *arg_types,
+ ...)
+{
+ dbus_bool_t success = FALSE;
+ va_list args;
+
+ va_start (args, arg_types);
+ success = dbind_method_call_reentrant_va (cnx,
+ bus_name,
+ path,
+ interface,
+ method,
+ opt_error,
+ arg_types,
+ args);
+ va_end (args);
+
+ return success;
+}
+
/*---------------------------------------------------------------------------*/
/**
diff --git a/dbind/dbind.h b/dbind/dbind.h
index 0f6cec85..c3e1d568 100644
--- a/dbind/dbind.h
+++ b/dbind/dbind.h
@@ -6,6 +6,16 @@
#include <dbind/dbind-any.h>
dbus_bool_t
+dbind_method_call_reentrant_va (DBusConnection *cnx,
+ const char *bus_name,
+ const char *path,
+ const char *interface,
+ const char *method,
+ DBusError *opt_error,
+ const char *arg_types,
+ va_list args);
+
+dbus_bool_t
dbind_method_call_reentrant (DBusConnection *cnx,
const char *bus_name,
const char *path,