1SD_BUS_MESSAGE_READ_STRV(3)sd_bus_message_read_strvSD_BUS_MESSAGE_READ_STRV(3)
2
3
4
6 sd_bus_message_read_strv, sd_bus_message_read_strv_extend - Access an
7 array of strings in a message
8
10 #include <systemd/sd-bus.h>
11
12 int sd_bus_message_read_strv(sd_bus_message *m, char ***l);
13
14 int sd_bus_message_read_strv_extend(sd_bus_message *m, char ***l);
15
17 sd_bus_message_read_strv() reads an array of string-like items from the
18 message m. The "read pointer" in the message must be right before an
19 array of strings (D-Bus type "as"), object paths (D-Bus type "ao"), or
20 signatures (D-Bus type "ag"). On success, a pointer to a
21 NULL-terminated array of strings (strv) is returned in the output
22 parameter l. Note that ownership of this array is transferred to the
23 caller. Hence, the caller is responsible for freeing this array and its
24 contents.
25
26 sd_bus_message_read_strv_extend() is similar, but the second parameter
27 is an input-output parameter. If *l is NULL, if behaves identically to
28 sd_bus_message_read_strv(). Otherwise, *l must point to a strv, which
29 will be reallocated and extended with additional strings. This function
30 is particularly useful when combining multiple lists of strings in a
31 message or messages into a single array of strings.
32
34 On success, these functions return a non-negative integer. On failure,
35 they return a negative errno-style error code.
36
37 Errors
38 Returned errors may indicate the following problems:
39
40 -EINVAL
41 m or l are NULL.
42
43 -EPERM
44 The message is not sealed.
45
46 -EBADMSG
47 The message cannot be parsed.
48
49 -ENXIO
50 The message "read pointer" is not right before an array of the
51 appropriate type.
52
54 systemd(1), sd-bus(3), sd_bus_message_read(3)
55
56
57
58systemd 254 SD_BUS_MESSAGE_READ_STRV(3)