3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-23 06:02:37 +01:00

dbus: add dbus_dict_append_string

This commit is contained in:
Denis Kenzior 2014-10-23 16:48:08 -05:00
parent 28f33d210d
commit c550fb01f9
2 changed files with 14 additions and 0 deletions

View File

@ -37,6 +37,17 @@ static void do_debug(const char *str, void *user_data)
l_info("%s%s", prefix, str); l_info("%s%s", prefix, str);
} }
void dbus_dict_append_string(struct l_dbus_message_builder *builder,
const char *key, const char *strval)
{
l_dbus_message_builder_enter_dict(builder, "sv");
l_dbus_message_builder_append_basic(builder, 's', key);
l_dbus_message_builder_enter_variant(builder, "s");
l_dbus_message_builder_append_basic(builder, 's', strval);
l_dbus_message_builder_leave_variant(builder);
l_dbus_message_builder_leave_dict(builder);
}
static void request_name_callback(struct l_dbus_message *message, static void request_name_callback(struct l_dbus_message *message,
void *user_data) void *user_data)
{ {

View File

@ -31,5 +31,8 @@ struct l_dbus;
struct l_dbus *dbus_get_bus(void); struct l_dbus *dbus_get_bus(void);
void dbus_dict_append_string(struct l_dbus_message_builder *builder,
const char *key, const char *strval);
bool dbus_init(void); bool dbus_init(void);
bool dbus_exit(void); bool dbus_exit(void);