[PATCH BlueZ 7/9] tools/bluetooth-player: Use g_dbus_dict_append_entry()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 tools/bluetooth-player.c | 38 +++-----------------------------------
 1 file changed, 3 insertions(+), 35 deletions(-)

diff --git a/tools/bluetooth-player.c b/tools/bluetooth-player.c
index 32ae4f6bb..074edfee9 100644
--- a/tools/bluetooth-player.c
+++ b/tools/bluetooth-player.c
@@ -702,39 +702,6 @@ static void cmd_change_folder(int argc, char *argv[])
 	bt_shell_printf("Attempting to change folder\n");
 }
 
-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 dict_append_entry(DBusMessageIter *dict,
-			const char *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, DBUS_TYPE_STRING, &key);
-
-	append_variant(&entry, type, val);
-
-	dbus_message_iter_close_container(dict, &entry);
-}
-
 struct list_items_args {
 	int start;
 	int end;
@@ -755,12 +722,13 @@ static void list_items_setup(DBusMessageIter *iter, void *user_data)
 	if (args->start < 0)
 		goto done;
 
-	dict_append_entry(&dict, "Start", DBUS_TYPE_UINT32, &args->start);
+	g_dbus_dict_append_entry(&dict, "Start",
+					DBUS_TYPE_UINT32, &args->start);
 
 	if (args->end < 0)
 		goto done;
 
-	dict_append_entry(&dict, "End", DBUS_TYPE_UINT32, &args->end);
+	g_dbus_dict_append_entry(&dict, "End", DBUS_TYPE_UINT32, &args->end);
 
 done:
 	dbus_message_iter_close_container(iter, &dict);
-- 
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux