From: Marcel Holtmann Date: Sat, 19 Dec 2009 21:23:15 +0000 (-0800) Subject: Add user data argument to D-Bus array property helpers X-Git-Tag: 2.0_alpha~3018 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7bc004006cb45f73276ef56edc03dac4177becc3;p=framework%2Fconnectivity%2Fconnman.git Add user data argument to D-Bus array property helpers --- diff --git a/include/dbus.h b/include/dbus.h index db681b9..bc25295 100644 --- a/include/dbus.h +++ b/include/dbus.h @@ -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); } diff --git a/src/dbus.c b/src/dbus.c index dbf3623..2253eaf 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -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); diff --git a/src/device.c b/src/device.c index 63aa915..41b131b 100644 --- a/src/device.c +++ b/src/device.c @@ -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); } diff --git a/src/notifier.c b/src/notifier.c index 2f682f7..de371be 100644 --- a/src/notifier.c +++ b/src/notifier.c @@ -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); } diff --git a/src/profile.c b/src/profile.c index fe9ddb8..808a7c0 100644 --- a/src/profile.c +++ b/src/profile.c @@ -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);