dbus: add dbus_dict_append_bool
This commit is contained in:
parent
c550fb01f9
commit
1ff34e3f0f
11
src/dbus.c
11
src/dbus.c
|
@ -48,6 +48,17 @@ void dbus_dict_append_string(struct l_dbus_message_builder *builder,
|
||||||
l_dbus_message_builder_leave_dict(builder);
|
l_dbus_message_builder_leave_dict(builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dbus_dict_append_bool(struct l_dbus_message_builder *builder,
|
||||||
|
const char *key, bool boolval)
|
||||||
|
{
|
||||||
|
l_dbus_message_builder_enter_dict(builder, "sv");
|
||||||
|
l_dbus_message_builder_append_basic(builder, 's', key);
|
||||||
|
l_dbus_message_builder_enter_variant(builder, "b");
|
||||||
|
l_dbus_message_builder_append_basic(builder, 'b', &boolval);
|
||||||
|
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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,6 +33,8 @@ struct l_dbus *dbus_get_bus(void);
|
||||||
|
|
||||||
void dbus_dict_append_string(struct l_dbus_message_builder *builder,
|
void dbus_dict_append_string(struct l_dbus_message_builder *builder,
|
||||||
const char *key, const char *strval);
|
const char *key, const char *strval);
|
||||||
|
void dbus_dict_append_bool(struct l_dbus_message_builder *builder,
|
||||||
|
const char *key, bool boolval);
|
||||||
|
|
||||||
bool dbus_init(void);
|
bool dbus_init(void);
|
||||||
bool dbus_exit(void);
|
bool dbus_exit(void);
|
||||||
|
|
Loading…
Reference in New Issue