1SD_BUS_SET_PROPERTY(3)        sd_bus_set_property       SD_BUS_SET_PROPERTY(3)
2
3
4

NAME

6       sd_bus_set_property, sd_bus_set_propertyv, sd_bus_get_property,
7       sd_bus_get_property_trivial, sd_bus_get_property_string,
8       sd_bus_get_property_strv - Set or query D-Bus service properties
9

SYNOPSIS

11       #include <systemd/sd-bus.h>
12
13       int sd_bus_set_property(sd_bus *bus, const char *destination,
14                               const char *path, const char *interface,
15                               const char *member, sd_bus_error *ret_error,
16                               const char *type, ...);
17
18       int sd_bus_set_propertyv(sd_bus *bus, const char *destination,
19                                const char *path, const char *interface,
20                                const char *member, sd_bus_error *ret_error,
21                                const char *type, va_list ap);
22
23       int sd_bus_get_property(sd_bus *bus, const char *destination,
24                               const char *path, const char *interface,
25                               const char *member, sd_bus_error *ret_error,
26                               sd_bus_message **reply, const char *type);
27
28       int sd_bus_get_property_trivial(sd_bus *bus, const char *destination,
29                                       const char *path,
30                                       const char *interface,
31                                       const char *member,
32                                       sd_bus_error *ret_error, char type,
33                                       void *ret_ptr);
34
35       int sd_bus_get_property_string(sd_bus *bus, const char *destination,
36                                      const char *path, const char *interface,
37                                      const char *member,
38                                      sd_bus_error *ret_error, char **ret);
39
40       int sd_bus_get_property_strv(sd_bus *bus, const char *destination,
41                                    const char *path, const char *interface,
42                                    const char *member,
43                                    sd_bus_error *ret_error, char ***ret);
44

DESCRIPTION

46       These functions set or query D-Bus properties. D-Bus properties are
47       service fields exposed via the org.freedesktop.DBus.Properties
48       interface. Under the hood, these functions call methods of the
49       org.freedesktop.DBus.Properties interface and as a result their
50       semantics are similar to sd_bus_call_method(3).
51
52       sd_bus_set_property() sets a D-Bus property. If setting the property
53       fails or an internal error occurs, an error is returned and an extended
54       description of the error is optionally stored in ret_error if it is not
55       NULL.  type and the arguments that follow it describe the new value of
56       the property and must follow the format described in
57       sd_bus_message_append(3).
58
59       sd_bus_set_propertyv() is equivalent to sd_bus_set_property(), except
60       that it is called with a "va_list" instead of a variable number of
61       arguments.
62
63       sd_bus_get_property() queries a D-Bus property. If retrieving the
64       property fails or an internal error occurs, an error is returned and an
65       extended description of the error is optionally stored in ret_error if
66       it is not NULL. On success, the property is stored in reply.  type
67       describes the property type and must follow the format described in
68       sd_bus_message_append(3).
69
70       sd_bus_get_property_trivial(), sd_bus_get_property_string() and
71       sd_bus_get_property_strv() are shorthands for sd_bus_get_property()
72       that are used to query basic, string and string vector properties
73       respectively. The caller is responsible for freeing the string and
74       string vector results stored in ret by sd_bus_get_property_string() and
75       sd_bus_get_property_strv().
76

RETURN VALUE

78       On success, these functions return a non-negative integer. On failure,
79       they return a negative errno-style error code.
80
81   Errors
82       See the sd_bus_call_method(3) man page for a list of possible errors.
83

NOTES

85       These APIs are implemented as a shared library, which can be compiled
86       and linked to with the libsystemd pkg-config(1) file.
87

SEE ALSO

89       systemd(1), sd-bus(3), sd_bus_call_method(3)
90
91
92
93systemd 250                                             SD_BUS_SET_PROPERTY(3)
Impressum