1SD_BUS_MESSAGE_READ_ARRAY(3)sd_bus_message_read_arraSyD_BUS_MESSAGE_READ_ARRAY(3)
2
3
4

NAME

6       sd_bus_message_read_array - Access an array of elements in a message
7

SYNOPSIS

9       #include <systemd/sd-bus.h>
10
11       int sd_bus_message_read_array(sd_bus_message *m, char type,
12                                     const void **ptr, size_t *size);
13

DESCRIPTION

15       sd_bus_message_read_array() gives access to an element array in message
16       m. The "read pointer" in the message must be right before an array of
17       type type. As a special case, type may be NUL, in which case any type
18       is acceptable. A pointer to the array data is returned in the parameter
19       ptr and the size of array data (in bytes) is returned in the parameter
20       size. If size is 0, a valid non-null pointer will be returned, but it
21       may not be dereferenced. The data is aligned as appropriate for the
22       data type. The data is part of the message — it may not be modified and
23       is valid only as long as the message is referenced. After this function
24       returns, the "read pointer" points at the next element after the array.
25
26       Note that this function only supports arrays of trivial types, i.e.
27       arrays of booleans, the various integer types, as well as floating
28       point numbers. In particular it may not be used for arrays of strings,
29       structures or similar.
30

RETURN VALUE

32       On success, sd_bus_message_read_array() returns 0 or a positive
33       integer. On failure, it returns a negative errno-style error code.
34
35   Errors
36       Returned errors may indicate the following problems:
37
38       -EINVAL
39           Specified type is invalid or not a trivial type (see above), or the
40           message parameter or one of the output parameters are NULL.
41
42       -EOPNOTSUPP
43           The byte order in the message is different than native byte order.
44
45       -EPERM
46           The message is not sealed.
47
48       -EBADMSG
49           The message cannot be parsed.
50

SEE ALSO

52       systemd(1), sd-bus(3), sd_bus_message_read(3)
53
54
55
56systemd 245                                       SD_BUS_MESSAGE_READ_ARRAY(3)
Impressum