From 08eaf27db9c11d06f889b0264d1d4228d0d529b5 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 31 May 2017 20:32:38 +0100 Subject: [PATCH 03/10] asv-util: Expose functions to open an arbitrary entry We'll need this to implement o.fd.DBus.Properties. Signed-off-by: Simon McVittie Reviewed-by: Philip Withnall Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101257 --- dbus/dbus-asv-util.c | 6 +++--- dbus/dbus-asv-util.h | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/dbus/dbus-asv-util.c b/dbus/dbus-asv-util.c index d3ac5e9c..fbb2e51e 100644 --- a/dbus/dbus-asv-util.c +++ b/dbus/dbus-asv-util.c @@ -80,7 +80,7 @@ _dbus_asv_new_method_return (DBusMessage *message, * @param var_iter will be initialized to append (i.e. write) to the variant * @returns #TRUE on success, or #FALSE if not enough memory */ -static dbus_bool_t +dbus_bool_t _dbus_asv_open_entry (DBusMessageIter *arr_iter, DBusMessageIter *entry_iter, const char *key, @@ -118,7 +118,7 @@ _dbus_asv_open_entry (DBusMessageIter *arr_iter, * @param var_iter the iterator appending to the variant, will be closed * @returns #TRUE on success, or #FALSE if not enough memory */ -static dbus_bool_t +dbus_bool_t _dbus_asv_close_entry (DBusMessageIter *arr_iter, DBusMessageIter *entry_iter, DBusMessageIter *var_iter) @@ -162,7 +162,7 @@ _dbus_asv_close (DBusMessageIter *iter, * @param arr_iter the iterator appending to the array, will be closed * @returns #TRUE on success, or #FALSE if not enough memory */ -static void +void _dbus_asv_abandon_entry (DBusMessageIter *arr_iter, DBusMessageIter *entry_iter, DBusMessageIter *var_iter) diff --git a/dbus/dbus-asv-util.h b/dbus/dbus-asv-util.h index 277ab807..a439008f 100644 --- a/dbus/dbus-asv-util.h +++ b/dbus/dbus-asv-util.h @@ -46,5 +46,16 @@ dbus_bool_t _dbus_asv_add_byte_array (DBusMessageIter *arr_iter, const char *key, const void *value, int n_elements); +dbus_bool_t _dbus_asv_open_entry (DBusMessageIter *arr_iter, + DBusMessageIter *entry_iter, + const char *key, + const char *type, + DBusMessageIter *var_iter); +dbus_bool_t _dbus_asv_close_entry (DBusMessageIter *arr_iter, + DBusMessageIter *entry_iter, + DBusMessageIter *var_iter); +void _dbus_asv_abandon_entry (DBusMessageIter *arr_iter, + DBusMessageIter *entry_iter, + DBusMessageIter *var_iter); #endif -- 2.11.0