]>
Commit | Line | Data |
---|---|---|
e5f1a3fa DDM |
1 | <?xml version='1.0'?> |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | |
db9ecf05 | 4 | <!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
e5f1a3fa DDM |
5 | |
6 | <refentry id="sd_bus_message_read_strv"> | |
7 | ||
8 | <refentryinfo> | |
9 | <title>sd_bus_message_read_strv</title> | |
10 | <productname>systemd</productname> | |
11 | </refentryinfo> | |
12 | ||
13 | <refmeta> | |
14 | <refentrytitle>sd_bus_message_read_strv</refentrytitle> | |
15 | <manvolnum>3</manvolnum> | |
16 | </refmeta> | |
17 | ||
18 | <refnamediv> | |
19 | <refname>sd_bus_message_read_strv</refname> | |
20 | ||
21 | <refpurpose>Access an array of strings in a message</refpurpose> | |
22 | </refnamediv> | |
23 | ||
24 | <refsynopsisdiv> | |
25 | <funcsynopsis> | |
26 | <funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo> | |
27 | ||
28 | <funcprototype> | |
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> | |
32 | </funcprototype> | |
33 | </funcsynopsis> | |
34 | </refsynopsisdiv> | |
35 | ||
36 | <refsect1> | |
37 | <title>Description</title> | |
38 | ||
63ab06c4 ZJS |
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> | |
e5f1a3fa DDM |
46 | </refsect1> |
47 | ||
48 | <refsect1> | |
49 | <title>Return Value</title> | |
50 | ||
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> | |
53 | ||
54 | <refsect2> | |
55 | <title>Errors</title> | |
56 | ||
57 | <para>Returned errors may indicate the following problems:</para> | |
58 | ||
59 | <variablelist> | |
60 | <varlistentry> | |
61 | <term><constant>-EINVAL</constant></term> | |
62 | ||
63 | <listitem><para><parameter>m</parameter> or <parameter>l</parameter> are <constant>NULL</constant>. | |
64 | </para></listitem> | |
65 | </varlistentry> | |
66 | ||
67 | <varlistentry> | |
68 | <term><constant>-EPERM</constant></term> | |
69 | ||
70 | <listitem><para>The message is not sealed.</para></listitem> | |
71 | </varlistentry> | |
72 | ||
73 | <varlistentry> | |
74 | <term><constant>-EBADMSG</constant></term> | |
75 | ||
76 | <listitem><para>The message cannot be parsed.</para></listitem> | |
77 | </varlistentry> | |
63ab06c4 ZJS |
78 | |
79 | <varlistentry> | |
80 | <term><constant>-ENXIO</constant></term> | |
81 | ||
82 | <listitem><para>The message "read pointer" is not right before an array of the appropriate type. | |
83 | </para></listitem> | |
84 | </varlistentry> | |
e5f1a3fa DDM |
85 | </variablelist> |
86 | </refsect2> | |
87 | </refsect1> | |
88 | ||
89 | <refsect1> | |
90 | <title>See Also</title> | |
91 | ||
92 | <para> | |
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> | |
96 | </para> | |
97 | </refsect1> | |
98 | ||
99 | </refentry> |