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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -71,3 +71,5 @@ int bus_register_malloc_status(sd_bus *bus, const char *destination);
|
||||
extern const struct hash_ops bus_message_hash_ops;
|
||||
|
||||
int bus_message_append_string_set(sd_bus_message *m, Set *s);
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user