From 6e1c9875c57811906e04f29856811f08ae08561f Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 11 Mar 2009 16:19:30 +0100 Subject: [PATCH] dbus: add support for struct Signed-off-by: Julien Danjou --- dbus.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dbus.c b/dbus.c index dd9851760..9a888f973 100644 --- a/dbus.c +++ b/dbus.c @@ -72,6 +72,22 @@ a_dbus_message_iter(DBusMessageIter *iter) } nargs++; break; + case DBUS_TYPE_STRUCT: + { + /* create a new table to store all the value */ + lua_newtable(globalconf.L); + + DBusMessageIter subiter; + /* initialize a sub iterator */ + dbus_message_iter_recurse(iter, &subiter); + /* create a new table to store the dict */ + int n = a_dbus_message_iter(&subiter); + + for(int i = n; i > 0; i--) + lua_rawseti(globalconf.L, - i - 1, i); + } + nargs++; + break; case DBUS_TYPE_ARRAY: { int array_type = dbus_message_iter_get_element_type(iter);