2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id=
"sd_bus_message_read_strv">
9 <title>sd_bus_message_read_strv
</title>
10 <productname>systemd
</productname>
14 <refentrytitle>sd_bus_message_read_strv
</refentrytitle>
15 <manvolnum>3</manvolnum>
19 <refname>sd_bus_message_read_strv
</refname>
21 <refpurpose>Access an array of strings in a message
</refpurpose>
26 <funcsynopsisinfo>#include
<systemd/sd-bus.h
></funcsynopsisinfo>
29 <funcdef>int
<function>sd_bus_message_read_strv
</function></funcdef>
30 <paramdef>sd_bus_message *
<parameter>m
</parameter></paramdef>
31 <paramdef>char ***
<parameter>l
</parameter></paramdef>
37 <title>Description
</title>
39 <para><function>sd_bus_message_read_strv()
</function> gives access to an array of string-like items in
40 message
<parameter>m
</parameter>. The
"read pointer" in the message must be right before an array of
41 strings (D-Bus type
<literal>as
</literal>), object paths (D-Bus type
<literal>ao
</literal>), or
42 signatures (D-Bus type
<literal>ag
</literal>). On success, a pointer to a
43 <constant>NULL
</constant>-terminated array of strings is returned in the output parameter
44 <parameter>l
</parameter>. Note that ownership of this array is transferred to the caller. Hence, the
45 caller is responsible for freeing this array and its contents.
</para>
49 <title>Return Value
</title>
51 <para>On success,
<function>sd_bus_message_read_strv()
</function> returns a non-negative integer. On
52 failure, it returns a negative errno-style error code.
</para>
57 <para>Returned errors may indicate the following problems:
</para>
61 <term><constant>-EINVAL
</constant></term>
63 <listitem><para><parameter>m
</parameter> or
<parameter>l
</parameter> are
<constant>NULL
</constant>.
68 <term><constant>-EPERM
</constant></term>
70 <listitem><para>The message is not sealed.
</para></listitem>
74 <term><constant>-EBADMSG
</constant></term>
76 <listitem><para>The message cannot be parsed.
</para></listitem>
80 <term><constant>-ENXIO
</constant></term>
82 <listitem><para>The message
"read pointer" is not right before an array of the appropriate type.
90 <title>See Also
</title>
93 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
94 <citerefentry><refentrytitle>sd-bus
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
95 <citerefentry><refentrytitle>sd_bus_message_read
</refentrytitle><manvolnum>3</manvolnum></citerefentry>