bus-util: add bus_property_get_string_set() helper

This is a common implementation of a property getter for a Set of
strings.
This commit is contained in:
Lennart Poettering
2023-06-12 11:35:52 +02:00
parent 9298af8dd3
commit fefefcd573
5 changed files with 23 additions and 53 deletions
+18
View File
@@ -697,3 +697,21 @@ int bus_message_append_string_set(sd_bus_message *m, Set *set) {
return sd_bus_message_close_container(m);
}
int bus_property_get_string_set(
sd_bus *bus,
const char *path,
const char *interface,
const char *property,
sd_bus_message *reply,
void *userdata,
sd_bus_error *error) {
Set **s = ASSERT_PTR(userdata);
assert(bus);
assert(property);
assert(reply);
return bus_message_append_string_set(reply, *s);
}