Debian Codegraph @

upstream/debian-unstable/man3/sd_bus_message_read_array.3

raw
1 '\" t
2 .TH "SD_BUS_MESSAGE_READ_ARRAY" "3" "" "systemd 261~rc3" "sd_bus_message_read_array"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 sd_bus_message_read_array \- Access an array of elements in a message
24 .SH "SYNOPSIS"
25 .sp
26 .ft B
27 .nf
28 #include <systemd/sd\-bus\&.h>
29 .fi
30 .ft
31 .HP \w'int\ sd_bus_message_read_array('u
32 .BI "int sd_bus_message_read_array(sd_bus_message\ *" "m" ", char\ " "type" ", const\ void\ **" "ptr" ", size_t\ *" "size" ");"
33 .SH "DESCRIPTION"
34 .PP
35 \fBsd_bus_message_read_array()\fR
36 provides access to an array elements in the bus message
37 \fIm\fR\&. The "read pointer" in the message must be right before an array of type
38 \fItype\fR\&. As a special case,
39 \fItype\fR
40 may be
41 \fBNUL\fR, in which case any trivial type is acceptable\&. A pointer to the array data is returned in the parameter
42 \fIptr\fR
43 and the size of array data (in bytes) is returned in the parameter
44 \fIsize\fR\&. If the returned
45 \fIsize\fR
46 parameter is 0, a valid non\-null pointer will be returned as
47 \fIptr\fR, but it may not be dereferenced\&. The data is aligned as appropriate for the data type\&. The data is part of the message \(em it may not be modified and is valid only as long as the message is referenced\&. After this function returns, the "read pointer" points at the next element after the array\&.
48 .PP
49 Note that this function only supports arrays of trivial types, i\&.e\&. arrays of booleans, the various integer types, as well as floating point numbers\&. In particular it may not be used for arrays of strings, structures or similar\&.
50 .SH "RETURN VALUE"
51 .PP
52 On success and when an array was read,
53 \fBsd_bus_message_read_array()\fR
54 returns an integer greater than zero\&. If invoked while inside a container element (such as an array, e\&.g\&. when operating on an array of arrays) and the final element of the outer container has been read already and the read pointer is thus behind the last element of the outer container this call returns 0 (and the returned pointer will be
55 \fBNULL\fR
56 and the size will be 0)\&. On failure, it returns a negative errno\-style error code\&.
57 .SS "Errors"
58 .PP
59 Returned errors may indicate the following problems:
60 .PP
61 \fB\-EINVAL\fR
62 .RS 4
63 Specified type is invalid or not a trivial type (see above), or the message parameter or one of the output parameters are
64 \fBNULL\fR\&.
65 .RE
66 .PP
67 \fB\-EOPNOTSUPP\fR
68 .RS 4
69 The byte order in the message is different than native byte order\&.
70 .RE
71 .PP
72 \fB\-EPERM\fR
73 .RS 4
74 The message is not sealed\&.
75 .RE
76 .PP
77 \fB\-EBADMSG\fR
78 .RS 4
79 The message cannot be parsed\&.
80 .RE
81 .SH "HISTORY"
82 .PP
83 \fBsd_bus_message_read_array()\fR
84 was added in version 240\&.
85 .SH "SEE ALSO"
86 .PP
87 \fBsystemd\fR(1), \fBsd-bus\fR(3), \fBsd_bus_message_read\fR(3), \fBsd_bus_message_read_strv\fR(3)