dbus: add support for struct

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-03-11 16:19:30 +01:00
parent e823596e5a
commit 6e1c9875c5

16
dbus.c
View file

@ -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);