dbus.h: Update include/dbus.h with more container support
authorTudor Marcu <tudor.a.marcu@intel.com>
Wed, 12 Sep 2012 22:05:57 +0000 (15:05 -0700)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Fri, 14 Sep 2012 13:32:00 +0000 (16:32 +0300)
Add a couple more functions for opening D-Bus message containers
with different signatures currently used by the command line client.

include/dbus.h

index 3f8dbadce1e7e3e7635da089d708c6bbaaced05f..bf5f8c14cde3d8a3bccf378bb5e2502981f3f394 100644 (file)
@@ -96,6 +96,25 @@ static inline void connman_dbus_dict_open(DBusMessageIter *iter,
                        DBUS_DICT_ENTRY_END_CHAR_AS_STRING, dict);
 }
 
+static inline void connman_dbus_dict_open_variant(DBusMessageIter *iter,
+                                                       DBusMessageIter *dict)
+{
+       dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT,
+                       DBUS_TYPE_ARRAY_AS_STRING
+                       DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
+                       DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_VARIANT_AS_STRING
+                       DBUS_DICT_ENTRY_END_CHAR_AS_STRING, dict);
+}
+
+static inline void connman_dbus_array_open(DBusMessageIter *iter,
+                                                       DBusMessageIter *dict)
+{
+       dbus_message_iter_open_container(iter, DBUS_TYPE_VARIANT,
+                       DBUS_TYPE_ARRAY_AS_STRING
+                       DBUS_TYPE_STRING_AS_STRING,
+                       dict);
+}
+
 static inline void connman_dbus_dict_close(DBusMessageIter *iter,
                                                        DBusMessageIter *dict)
 {