[Telepathy-commits] [telepathy-mission-control/master] Implement _mc_iface_call_when_all_readyv()

mardy mardy at 64d1ce6a-1406-0410-9ac8-afed03b27183
Mon Nov 17 00:05:12 PST 2008


_mc_iface_call_when_all_readyv() is like _mc_iface_call_when_all_ready(), but
accepts the interfaces to be listed in an array instead of a va_list.

git-svn-id: https://projects.maemo.org/svn/chavo/trunk/framework/open/telepathy-mission-control@20533 64d1ce6a-1406-0410-9ac8-afed03b27183
---
 libmcclient/dbus-api.c |   29 +++++++++++++++++++++++++++++
 libmcclient/dbus-api.h |    6 ++++++
 2 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/libmcclient/dbus-api.c b/libmcclient/dbus-api.c
index a14d9d8..42d8998 100644
--- a/libmcclient/dbus-api.c
+++ b/libmcclient/dbus-api.c
@@ -318,3 +318,32 @@ _mc_iface_call_when_all_ready (TpProxy *proxy, GType type,
     multi_cb_data_free (mcbd);
 }
 
+void
+_mc_iface_call_when_all_readyv (TpProxy *proxy, GType type,
+				McIfaceWhenReadyCb callback,
+				gpointer user_data, GDestroyNotify destroy,
+				GObject *weak_object,
+				guint n_ifaces, GQuark *ifaces)
+{
+    GQuark iface;
+    MultiCbData *mcbd;
+    guint i;
+
+    mcbd = g_slice_new0 (MultiCbData);
+    mcbd->callback = callback;
+    mcbd->user_data = user_data;
+    mcbd->destroy = destroy;
+    mcbd->ref_count = 1;
+
+    for (i = 0; i < n_ifaces; i++)
+    {
+	iface = ifaces[i];
+	mcbd->remaining_ifaces++;
+	mcbd->ref_count++;
+	_mc_iface_call_when_ready (proxy, type, iface,
+				   call_when_all_ready_cb,
+				   mcbd, multi_cb_data_free, weak_object);
+    }
+    multi_cb_data_free (mcbd);
+}
+
diff --git a/libmcclient/dbus-api.h b/libmcclient/dbus-api.h
index dc7344c..4213d27 100644
--- a/libmcclient/dbus-api.h
+++ b/libmcclient/dbus-api.h
@@ -86,6 +86,12 @@ void _mc_iface_call_when_all_ready (TpProxy *proxy, GType type,
 				    McIfaceWhenReadyCb callback,
 				    gpointer user_data, GDestroyNotify destroy,
 				    GObject *weak_object, va_list ifaces);
+void _mc_iface_call_when_all_readyv (TpProxy *proxy, GType type,
+				     McIfaceWhenReadyCb callback,
+				     gpointer user_data,
+				     GDestroyNotify destroy,
+				     GObject *weak_object,
+				     guint n_ifaces, GQuark *ifaces);
 void _mc_iface_cancel_callback (CallWhenReadyContext *ctx);
 
 void _mc_iface_add (GType type, GQuark interface,
-- 
1.5.6.5




More information about the Telepathy-commits mailing list