mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-16 07:47:22 +01:00
dbus: fix fixed array handling
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
01a74e9c9e
commit
dd862007a9
1 changed files with 7 additions and 2 deletions
9
dbus.c
9
dbus.c
|
@ -80,14 +80,18 @@ a_dbus_message_iter(DBusMessageIter *iter)
|
||||||
lua_newtable(globalconf.L);
|
lua_newtable(globalconf.L);
|
||||||
|
|
||||||
if(dbus_type_is_fixed(array_type))
|
if(dbus_type_is_fixed(array_type))
|
||||||
|
{
|
||||||
|
DBusMessageIter sub;
|
||||||
|
dbus_message_iter_recurse(iter, &sub);
|
||||||
|
|
||||||
switch(array_type)
|
switch(array_type)
|
||||||
{
|
{
|
||||||
int datalen;
|
int datalen = 0;
|
||||||
#define DBUS_MSG_HANDLE_ARRAY_TYPE_NUMBER(type, dbustype) \
|
#define DBUS_MSG_HANDLE_ARRAY_TYPE_NUMBER(type, dbustype) \
|
||||||
case dbustype: \
|
case dbustype: \
|
||||||
{ \
|
{ \
|
||||||
type *data; \
|
type *data; \
|
||||||
dbus_message_iter_get_fixed_array(iter, &data, &datalen); \
|
dbus_message_iter_get_fixed_array(&sub, &data, &datalen); \
|
||||||
for(int i = 0; i < datalen; i++) \
|
for(int i = 0; i < datalen; i++) \
|
||||||
{ \
|
{ \
|
||||||
lua_pushnumber(globalconf.L, data[i]); \
|
lua_pushnumber(globalconf.L, data[i]); \
|
||||||
|
@ -103,6 +107,7 @@ a_dbus_message_iter(DBusMessageIter *iter)
|
||||||
DBUS_MSG_HANDLE_ARRAY_TYPE_NUMBER(uint64_t, DBUS_TYPE_UINT64)
|
DBUS_MSG_HANDLE_ARRAY_TYPE_NUMBER(uint64_t, DBUS_TYPE_UINT64)
|
||||||
#undef DBUS_MSG_HANDLE_ARRAY_TYPE_NUMBER
|
#undef DBUS_MSG_HANDLE_ARRAY_TYPE_NUMBER
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if(array_type == DBUS_TYPE_DICT_ENTRY)
|
else if(array_type == DBUS_TYPE_DICT_ENTRY)
|
||||||
{
|
{
|
||||||
DBusMessageIter subiter;
|
DBusMessageIter subiter;
|
||||||
|
|
Loading…
Reference in a new issue