From 4b7f8d78de683eb3056052d09705b856b1104964 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 10 Apr 2020 21:46:46 +0200 Subject: [PATCH] sd-bus: Add sd_bus_get/set_property docs --- man/rules/meson.build | 8 ++ man/sd-bus.xml | 6 ++ man/sd_bus_call_method.xml | 2 +- man/sd_bus_set_property.xml | 176 ++++++++++++++++++++++++++++++++++++ 4 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 man/sd_bus_set_property.xml diff --git a/man/rules/meson.build b/man/rules/meson.build index 16e0ffca3f..386ca629fd 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -359,6 +359,14 @@ manpages = [ '3', ['sd_bus_get_method_call_timeout'], ''], + ['sd_bus_set_property', + '3', + ['sd_bus_get_property', + 'sd_bus_get_property_string', + 'sd_bus_get_property_strv', + 'sd_bus_get_property_trivial', + 'sd_bus_set_propertyv'], + ''], ['sd_bus_set_sender', '3', ['sd_bus_get_sender'], ''], ['sd_bus_set_watch_bind', '3', ['sd_bus_get_watch_bind'], ''], ['sd_bus_slot_get_bus', diff --git a/man/sd-bus.xml b/man/sd-bus.xml index 4f1d8355d6..c70e9e1787 100644 --- a/man/sd-bus.xml +++ b/man/sd-bus.xml @@ -70,6 +70,10 @@ sd_bus_message_dump3, sd_bus_message_get_cookie3, sd_bus_message_get_monotonic_usec3, +sd_bus_message_get_property3, +sd_bus_message_get_property_trivial3, +sd_bus_message_get_property_string3, +sd_bus_message_get_property_strv3, sd_bus_message_get_sender3, sd_bus_message_get_signature3, sd_bus_message_get_type3, @@ -99,6 +103,8 @@ sd_bus_set_connected_signal3, sd_bus_set_description3, sd_bus_set_method_call_timeout3, +sd_bus_set_property3, +sd_bus_set_propertyv3, sd_bus_set_sender3, sd_bus_set_watch_bind3 sd_bus_set_close_on_exit3, diff --git a/man/sd_bus_call_method.xml b/man/sd_bus_call_method.xml index 870a78035a..e1e9ad3b48 100644 --- a/man/sd_bus_call_method.xml +++ b/man/sd_bus_call_method.xml @@ -133,7 +133,7 @@ sd_bus_message_new_method_call3, sd_bus_message_append3, sd_bus_call3, - sd_bus_call_async3 + sd_bus_set_property3, diff --git a/man/sd_bus_set_property.xml b/man/sd_bus_set_property.xml new file mode 100644 index 0000000000..411ccad28c --- /dev/null +++ b/man/sd_bus_set_property.xml @@ -0,0 +1,176 @@ + + + + + + + + sd_bus_set_property + systemd + + + + sd_bus_set_property + 3 + + + + sd_bus_set_property + sd_bus_set_propertyv + sd_bus_get_property + sd_bus_get_property_trivial + sd_bus_get_property_string + sd_bus_get_property_strv + + Set or query D-Bus service properties + + + + + #include <systemd/sd-bus.h> + + + int sd_bus_set_property + sd_bus *bus + const char *destination + const char *path + const char *interface + const char *member + sd_bus_error *ret_error + sd_bus_message **reply + const char *type + ... + + + + int sd_bus_set_propertyv + sd_bus *bus + const char *destination + const char *path + const char *interface + const char *member + sd_bus_error *ret_error + sd_bus_message **reply + const char *type + va_list ap + + + + int sd_bus_get_property + sd_bus *bus + const char *destination + const char *path + const char *interface + const char *member + sd_bus_error *ret_error + sd_bus_message **reply + const char *type + + + + int sd_bus_get_property_trivial + sd_bus *bus + const char *destination + const char *path + const char *interface + const char *member + sd_bus_error *ret_error + char type + void *ret_ptr + + + + int sd_bus_get_property_string + sd_bus *bus + const char *destination + const char *path + const char *interface + const char *member + sd_bus_error *ret_error + char **ret + + + + int sd_bus_get_property_strv + sd_bus *bus + const char *destination + const char *path + const char *interface + const char *member + sd_bus_error *ret_error + char ***ret + + + + + + Description + + These functions set or query D-Bus properties. D-Bus properties are service fields exposed + via the org.freedesktop.DBus.Properties interface. Under the hood, these + functions call methods of the org.freedesktop.DBus.Properties interface and + as a result their semantics are similar to + sd_bus_call_method3. + + + sd_bus_set_property() sets a D-Bus property. On success, the response + is stored in reply. If setting the property fails or an internal error + occurs, an error is returned and an extended description of the error is optionally stored in + ret_error if it is not NULL. + type and the arguments that follow it describe the new value of the + property and must follow the format described in + sd_bus_message_append3. + + + sd_bus_set_propertyv() is equivalent to + sd_bus_set_property(), except that it is called with a + va_list instead of a variable number of arguments. + + sd_bus_get_property() queries a D-Bus property. If retrieving the + property fails or an internal error occurs, an error is returned and an extended description of + the error is optionally stored in ret_error if it is not + NULL. On success, the property is stored in reply. + type describes the property type and must follow the format described in + sd_bus_message_append3. + + + sd_bus_get_property_trivial(), + sd_bus_get_property_string() and + sd_bus_get_property_strv() are shorthands for + sd_bus_get_property() that are used to query basic, string and string + vector properties respectively. The caller is responsible for freeing the string and string + vector results stored in ret by + sd_bus_get_property_string() and + sd_bus_get_property_strv(). + + + + Return Value + + On success, these functions return a non-negative integer. On failure, they return a + negative errno-style error code. + + + Errors + + See the + sd_bus_call_method3 + man page for a list of possible errors + + + + + + + See Also + + + systemd1, + sd-bus3, + sd_bus_call_method3 + + + +