summaryrefslogtreecommitdiff
path: root/src/dbus-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dbus-common.c')
-rw-r--r--src/dbus-common.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/dbus-common.c b/src/dbus-common.c
index 5bfaf361fb..4b9b457fc3 100644
--- a/src/dbus-common.c
+++ b/src/dbus-common.c
@@ -821,3 +821,19 @@ int bus_append_strv_iter(DBusMessageIter *iter, char **l) {
return 0;
}
+
+int bus_iter_get_basic_and_next(DBusMessageIter *iter, int type, void *data, bool next) {
+
+ assert(iter);
+ assert(data);
+
+ if (dbus_message_iter_get_arg_type(iter) != type)
+ return -EIO;
+
+ dbus_message_iter_get_basic(iter, data);
+
+ if (!dbus_message_iter_next(iter) != !next)
+ return -EIO;
+
+ return 0;
+}