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.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/dbus-common.c b/src/dbus-common.c
index e439a42486..73f9e87eed 100644
--- a/src/dbus-common.c
+++ b/src/dbus-common.c
@@ -463,23 +463,12 @@ int bus_property_append_string(DBusMessageIter *i, const char *property, void *d
}
int bus_property_append_strv(DBusMessageIter *i, const char *property, void *data) {
- DBusMessageIter sub;
char **t = data;
assert(i);
assert(property);
- if (!dbus_message_iter_open_container(i, DBUS_TYPE_ARRAY, "s", &sub))
- return -ENOMEM;
-
- STRV_FOREACH(t, t)
- if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, t))
- return -ENOMEM;
-
- if (!dbus_message_iter_close_container(i, &sub))
- return -ENOMEM;
-
- return 0;
+ return bus_append_strv_iter(i, t);
}
int bus_property_append_bool(DBusMessageIter *i, const char *property, void *data) {
@@ -796,3 +785,21 @@ int bus_parse_strv_iter(DBusMessageIter *iter, char ***_l) {
return 0;
}
+
+int bus_append_strv_iter(DBusMessageIter *iter, char **l) {
+ DBusMessageIter sub;
+
+ assert(iter);
+
+ if (!dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, "s", &sub))
+ return -ENOMEM;
+
+ STRV_FOREACH(l, l)
+ if (!dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, l))
+ return -ENOMEM;
+
+ if (!dbus_message_iter_close_container(iter, &sub))
+ return -ENOMEM;
+
+ return 0;
+}