dbus-common: Remove unused functions 26/204926/1
authorERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
Thu, 1 Mar 2018 04:27:42 +0000 (13:27 +0900)
committerAmit Purwar <amit.purwar@samsung.com>
Fri, 26 Apr 2019 10:28:41 +0000 (15:58 +0530)
Change-Id: I580a497600bbe7c2521f5303fdbd2069b60a558b
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
src/dbus-common.c
src/dbus-common.h
src/device.c

index adb0a7a..6e2097a 100755 (executable)
 
 static DBusConnection *connection = NULL;
 
-static void append_variant(DBusMessageIter *iter, int type, void *val)
-{
-       DBusMessageIter value;
-       char sig[2] = { type, '\0' };
-
-       dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT, sig, &value);
-
-       dbus_message_iter_append_basic(&value, type, val);
-
-       dbus_message_iter_close_container(iter, &value);
-}
-
-static void append_array_variant(DBusMessageIter *iter, int type, void *val,
-                                                       int n_elements)
-{
-       DBusMessageIter variant, array;
-       char type_sig[2] = { type, '\0' };
-       char array_sig[3] = { DBUS_TYPE_ARRAY, type, '\0' };
-
-       dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT,
-                                               array_sig, &variant);
-
-       dbus_message_iter_open_container(&variant, DBUS_TYPE_ARRAY,
-                                               type_sig, &array);
-
-       if (dbus_type_is_fixed(type) == TRUE) {
-               dbus_message_iter_append_fixed_array(&array, type, val,
-                                                       n_elements);
-       } else if (type == DBUS_TYPE_STRING || type == DBUS_TYPE_OBJECT_PATH) {
-               const char ***str_array = val;
-               int i;
-
-               for (i = 0; i < n_elements; i++)
-                       dbus_message_iter_append_basic(&array, type,
-                                                       &((*str_array)[i]));
-       }
-
-       dbus_message_iter_close_container(&variant, &array);
-
-       dbus_message_iter_close_container(iter, &variant);
-}
-
-void dict_append_basic(DBusMessageIter *dict, int key_type, const void *key,
-                                               int type, void *val)
-{
-       DBusMessageIter entry;
-
-       if (type == DBUS_TYPE_STRING) {
-               const char *str = *((const char **) val);
-               if (str == NULL)
-                       return;
-       }
-
-       dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY,
-                                                       NULL, &entry);
-
-       dbus_message_iter_append_basic(&entry, key_type, key);
-
-       append_variant(&entry, type, val);
-
-       dbus_message_iter_close_container(dict, &entry);
-
-}
-
 void dict_append_entry(DBusMessageIter *dict,
                        const char *key, int type, void *val)
 {
-       dict_append_basic(dict, DBUS_TYPE_STRING, &key, type, val);
-}
-
-void dict_append_basic_array(DBusMessageIter *dict, int key_type,
-                                       const void *key, int type, void *val,
-                                       int n_elements)
-{
-       DBusMessageIter entry;
-
-       dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY,
-                                               NULL, &entry);
-
-       dbus_message_iter_append_basic(&entry, key_type, key);
-
-       append_array_variant(&entry, type, val, n_elements);
-
-       dbus_message_iter_close_container(dict, &entry);
+       g_dbus_dict_append_entry(dict, key, type, val);
 }
 
 void dict_append_array(DBusMessageIter *dict, const char *key, int type,
                        void *val, int n_elements)
 {
-       dict_append_basic_array(dict, DBUS_TYPE_STRING, &key, type, val,
-                                                               n_elements);
+       g_dbus_dict_append_array(dict, key, type, val, n_elements);
 }
 
 void set_dbus_connection(DBusConnection *conn)
index 2e7d51e..fbf4acd 100755 (executable)
  *
  */
 
-void dict_append_basic(DBusMessageIter *dict, int key_type, const void *key,
-                                               int type, void *val);
 void dict_append_entry(DBusMessageIter *dict,
                        const char *key, int type, void *val);
-
-void dict_append_basic_array(DBusMessageIter *dict, int key_type,
-                                       const void *key, int type, void *val,
-                                       int n_elements);
 void dict_append_array(DBusMessageIter *dict, const char *key, int type,
                        void *val, int n_elements);
 
index b2871c7..9dc0b26 100644 (file)
@@ -1683,7 +1683,8 @@ static void append_manufacturer_data(void *data, void *user_data)
        struct bt_ad_manufacturer_data *md = data;
        DBusMessageIter *dict = user_data;
 
-       dict_append_basic_array(dict, DBUS_TYPE_UINT16, &md->manufacturer_id,
+       g_dbus_dict_append_basic_array(dict,
+                               DBUS_TYPE_UINT16, &md->manufacturer_id,
                                DBUS_TYPE_BYTE, &md->data, md->len);
 }