man-pages/man3/sd_bus_message_read_array.3.html
2021-03-31 01:06:50 +01:00

140 lines
3.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SD_BUS_MESSAGE_READ_ARRAY</TITLE>
</HEAD><BODY>
<H1>SD_BUS_MESSAGE_READ_ARRAY</H1>
Section: sd_bus_message_read_array (3)<BR>Updated: <BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
sd_bus_message_read_array - Access an array of elements in a message
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<B>
</B><PRE>
#include &lt;<A HREF="file:///usr/include/systemd/sd-bus.h">systemd/sd-bus.h</A>&gt;
</PRE>
<DL COMPACT>
<DT id="1">
<B>int sd_bus_message_read_array(sd_bus_message&nbsp;*</B><I>m</I><B>, char&nbsp;</B><I>type</I><B>, const&nbsp;void&nbsp;**</B><I>ptr</I><B>, size_t&nbsp;*</B><I>size</I><B>);</B>
</DL>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
<B>sd_bus_message_read_array()</B>
<DD>gives access to an element array in message
<I>m</I>. The &quot;read pointer&quot; in the message must be right before an array of type
<I>type</I>. As a special case,
<I>type</I>
may be
<B>NUL</B>, in which case any type is acceptable. A pointer to the array data is returned in the parameter
<I>ptr</I>
and the size of array data (in bytes) is returned in the parameter
<I>size</I>. If
<I>size</I>
is 0, a valid non-null pointer will be returned, but it may not be dereferenced. The data is aligned as appropriate for the data type. The data is part of the message --- it may not be modified and is valid only as long as the message is referenced. After this function returns, the &quot;read pointer&quot; points at the next element after the array.
<P>
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.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
<P>
On success,
<B>sd_bus_message_read_array()</B>
returns 0 or a positive integer. On failure, it returns a negative errno-style error code.
<A NAME="lbAF">&nbsp;</A>
<H3>Errors</H3>
<P>
Returned errors may indicate the following problems:
<P>
<B>-EINVAL</B>
<DL COMPACT><DT id="2"><DD>
Specified type is invalid or not a trivial type (see above), or the message parameter or one of the output parameters are
<B>NULL</B>.
</DL>
<P>
<B>-EOPNOTSUPP</B>
<DL COMPACT><DT id="3"><DD>
The byte order in the message is different than native byte order.
</DL>
<P>
<B>-EPERM</B>
<DL COMPACT><DT id="4"><DD>
The message is not sealed.
</DL>
<P>
<B>-EBADMSG</B>
<DL COMPACT><DT id="5"><DD>
The message cannot be parsed.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<P>
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?3+sd-bus">sd-bus</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_message_read">sd_bus_message_read</A></B>(3)
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="8"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="9"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DL>
<DT id="10"><A HREF="#lbAF">Errors</A><DD>
</DL>
<DT id="11"><A HREF="#lbAG">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:54 GMT, March 31, 2021
</BODY>
</HTML>