From: Marcel Holtmann Date: Sat, 19 Dec 2009 21:33:00 +0000 (-0800) Subject: Add user data parameter to dictionary helpers X-Git-Tag: 0.48~71 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=79cbf44dd3a1756c3a87f1e7d6d5fc3c3af7bb32;p=platform%2Fupstream%2Fconnman.git Add user data parameter to dictionary helpers --- diff --git a/include/dbus.h b/include/dbus.h index bc25295..83f24f9 100644 --- a/include/dbus.h +++ b/include/dbus.h @@ -93,13 +93,14 @@ static inline void connman_dbus_dict_append_basic(DBusMessageIter *dict, } static inline void connman_dbus_dict_append_dict(DBusMessageIter *dict, - const char *key, connman_dbus_append_cb_t function) + const char *key, connman_dbus_append_cb_t function, + void *user_data) { DBusMessageIter entry; dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry); - connman_dbus_property_append_dict(&entry, key, function, NULL); + connman_dbus_property_append_dict(&entry, key, function, user_data); dbus_message_iter_close_container(dict, &entry); } @@ -115,14 +116,15 @@ static inline void connman_dbus_dict_append_fixed_array(DBusMessageIter *dict, } static inline void connman_dbus_dict_append_variable_array(DBusMessageIter *dict, - 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 entry; dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry); connman_dbus_property_append_variable_array(&entry, key, - type, function, NULL); + type, function, user_data); dbus_message_iter_close_container(dict, &entry); } diff --git a/src/manager.c b/src/manager.c index d512b24..4d53aad 100644 --- a/src/manager.c +++ b/src/manager.c @@ -55,14 +55,14 @@ static DBusMessage *get_properties(DBusConnection *conn, DBUS_TYPE_OBJECT_PATH, &str); connman_dbus_dict_append_variable_array(&dict, "Profiles", - DBUS_TYPE_OBJECT_PATH, __connman_profile_list); + DBUS_TYPE_OBJECT_PATH, __connman_profile_list, NULL); connman_dbus_dict_append_variable_array(&dict, "Services", - DBUS_TYPE_OBJECT_PATH, __connman_service_list); + DBUS_TYPE_OBJECT_PATH, __connman_service_list, NULL); connman_dbus_dict_append_variable_array(&dict, "Providers", - DBUS_TYPE_OBJECT_PATH, __connman_provider_list); + DBUS_TYPE_OBJECT_PATH, __connman_provider_list, NULL); connman_dbus_dict_append_variable_array(&dict, "Devices", - DBUS_TYPE_OBJECT_PATH, __connman_device_list); + DBUS_TYPE_OBJECT_PATH, __connman_device_list, NULL); if (__connman_element_count(NULL, CONNMAN_ELEMENT_TYPE_CONNECTION) > 0) str = "online"; @@ -77,11 +77,11 @@ static DBusMessage *get_properties(DBusConnection *conn, DBUS_TYPE_BOOLEAN, &offlinemode); connman_dbus_dict_append_variable_array(&dict, "AvailableTechnologies", - DBUS_TYPE_STRING, __connman_notifier_list_registered); + DBUS_TYPE_STRING, __connman_notifier_list_registered, NULL); connman_dbus_dict_append_variable_array(&dict, "EnabledTechnologies", - DBUS_TYPE_STRING, __connman_notifier_list_enabled); + DBUS_TYPE_STRING, __connman_notifier_list_enabled, NULL); connman_dbus_dict_append_variable_array(&dict, "ConnectedTechnologies", - DBUS_TYPE_STRING, __connman_notifier_list_connected); + DBUS_TYPE_STRING, __connman_notifier_list_connected, NULL); str = __connman_service_default(); if (str != NULL) @@ -89,9 +89,9 @@ static DBusMessage *get_properties(DBusConnection *conn, DBUS_TYPE_STRING, &str); connman_dbus_dict_append_variable_array(&dict, "AvailableDebugs", - DBUS_TYPE_STRING, __connman_debug_list_available); + DBUS_TYPE_STRING, __connman_debug_list_available, NULL); connman_dbus_dict_append_variable_array(&dict, "EnabledDebugs", - DBUS_TYPE_STRING, __connman_debug_list_enabled); + DBUS_TYPE_STRING, __connman_debug_list_enabled, NULL); connman_dbus_dict_close(&array, &dict); diff --git a/src/profile.c b/src/profile.c index 808a7c0..74fa0f7 100644 --- a/src/profile.c +++ b/src/profile.c @@ -269,7 +269,7 @@ static DBusMessage *get_properties(DBusConnection *conn, DBUS_TYPE_BOOLEAN, &profile->offlinemode); connman_dbus_dict_append_variable_array(&dict, "Services", - DBUS_TYPE_OBJECT_PATH, __connman_service_list); + DBUS_TYPE_OBJECT_PATH, __connman_service_list, NULL); connman_dbus_dict_close(&array, &dict); diff --git a/src/service.c b/src/service.c index 3c68aab..0fb4453 100644 --- a/src/service.c +++ b/src/service.c @@ -528,7 +528,8 @@ static DBusMessage *get_properties(DBusConnection *conn, break; } - connman_dbus_dict_append_dict(&dict, "Settings", append_settings); + connman_dbus_dict_append_dict(&dict, "Settings", + append_settings, service); if (service->ipconfig != NULL) __connman_ipconfig_append_ipv4(service->ipconfig,