Add user data argument to D-Bus array property helpers
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 19 Dec 2009 21:23:15 +0000 (13:23 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 19 Dec 2009 21:23:15 +0000 (13:23 -0800)
include/dbus.h
src/dbus.c
src/device.c
src/notifier.c
src/profile.c

index db681b9..bc25295 100644 (file)
@@ -55,8 +55,9 @@ void connman_dbus_property_append_dict(DBusMessageIter *iter, const char *key,
                        connman_dbus_append_cb_t function, void *user_data);
 void connman_dbus_property_append_fixed_array(DBusMessageIter *iter,
                                const char *key, int type, void *val, int len);
-void connman_dbus_property_append_variable_array(DBusMessageIter *dict,
-               const char *key, int type, connman_dbus_append_cb_t function);
+void connman_dbus_property_append_variable_array(DBusMessageIter *iter,
+                                               const char *key, int type,
+                       connman_dbus_append_cb_t function, void *user_data);
 
 dbus_bool_t connman_dbus_property_changed_basic(const char *path,
                                const char *interface, const char *key,
@@ -121,7 +122,7 @@ static inline void connman_dbus_dict_append_variable_array(DBusMessageIter *dict
        dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY,
                                                                NULL, &entry);
        connman_dbus_property_append_variable_array(&entry, key,
-                                                       type, function);
+                                                       type, function, NULL);
        dbus_message_iter_close_container(dict, &entry);
 }
 
index dbf3623..2253eaf 100644 (file)
@@ -168,7 +168,8 @@ void connman_dbus_property_append_fixed_array(DBusMessageIter *iter,
 }
 
 void connman_dbus_property_append_variable_array(DBusMessageIter *iter,
-               const char *key, int type, connman_dbus_append_cb_t function)
+                                               const char *key, int type,
+                       connman_dbus_append_cb_t function, void *user_data)
 {
        DBusMessageIter value, array;
        const char *variant_sig, *array_sig;
@@ -194,7 +195,7 @@ void connman_dbus_property_append_variable_array(DBusMessageIter *iter,
        dbus_message_iter_open_container(&value, DBUS_TYPE_ARRAY,
                                                        array_sig, &array);
        if (function)
-               function(&array, NULL);
+               function(&array, user_data);
        dbus_message_iter_close_container(&value, &array);
 
        dbus_message_iter_close_container(iter, &value);
index 63aa915..41b131b 100644 (file)
@@ -505,7 +505,7 @@ static void emit_devices_signal(void)
 
        dbus_message_iter_init_append(signal, &iter);
        connman_dbus_property_append_variable_array(&iter, "Devices",
-                               DBUS_TYPE_OBJECT_PATH, __connman_device_list);
+                       DBUS_TYPE_OBJECT_PATH, __connman_device_list, NULL);
 
        g_dbus_send_message(connection, signal);
 }
index 2f682f7..de371be 100644 (file)
@@ -140,7 +140,7 @@ static void technology_registered(enum connman_service_type type,
        dbus_message_iter_init_append(signal, &iter);
        connman_dbus_property_append_variable_array(&iter,
                                "AvailableTechnologies", DBUS_TYPE_STRING,
-                                       __connman_notifier_list_registered);
+                               __connman_notifier_list_registered, NULL);
 
        g_dbus_send_message(connection, signal);
 }
@@ -162,7 +162,7 @@ static void technology_enabled(enum connman_service_type type,
        dbus_message_iter_init_append(signal, &iter);
        connman_dbus_property_append_variable_array(&iter,
                                "EnabledTechnologies", DBUS_TYPE_STRING,
-                                       __connman_notifier_list_enabled);
+                               __connman_notifier_list_enabled, NULL);
 
        g_dbus_send_message(connection, signal);
 
@@ -191,7 +191,7 @@ static void technology_connected(enum connman_service_type type,
        dbus_message_iter_init_append(signal, &iter);
        connman_dbus_property_append_variable_array(&iter,
                                "ConnectedTechnologies", DBUS_TYPE_STRING,
-                                       __connman_notifier_list_connected);
+                               __connman_notifier_list_connected, NULL);
 
        g_dbus_send_message(connection, signal);
 }
index fe9ddb8..808a7c0 100644 (file)
@@ -72,7 +72,7 @@ static void profiles_changed(void)
 
        dbus_message_iter_init_append(signal, &iter);
        connman_dbus_property_append_variable_array(&iter, "Profiles",
-                               DBUS_TYPE_OBJECT_PATH, __connman_profile_list);
+                       DBUS_TYPE_OBJECT_PATH, __connman_profile_list, NULL);
 
        g_dbus_send_message(connection, signal);
 }
@@ -167,10 +167,10 @@ static gboolean services_changed(gpointer user_data)
        dbus_message_iter_init_append(signal, &iter);
        if (g_strcmp0(profile->ident, PROFILE_DEFAULT_IDENT) == 0)
                connman_dbus_property_append_variable_array(&iter, "Services",
-                               DBUS_TYPE_OBJECT_PATH, __connman_service_list);
+                       DBUS_TYPE_OBJECT_PATH, __connman_service_list, NULL);
        else
                connman_dbus_property_append_variable_array(&iter, "Services",
-                                               DBUS_TYPE_OBJECT_PATH, NULL);
+                                       DBUS_TYPE_OBJECT_PATH, NULL, NULL);
 
        g_dbus_send_message(connection, signal);
 
@@ -184,7 +184,7 @@ static gboolean services_changed(gpointer user_data)
 
        dbus_message_iter_init_append(signal, &iter);
        connman_dbus_property_append_variable_array(&iter, "Services",
-                               DBUS_TYPE_OBJECT_PATH, __connman_service_list);
+                       DBUS_TYPE_OBJECT_PATH, __connman_service_list, NULL);
 
        g_dbus_send_message(connection, signal);