1:255.13-alt1
[systemd_ALT.git] / man / sd_bus_message_append_string_memfd.xml
blob5a4db0d369460eb65b00772d4238c7f6aa88e210
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">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
6 <refentry id="sd_bus_message_append_string_memfd"
7           xmlns:xi="http://www.w3.org/2001/XInclude">
9   <refentryinfo>
10     <title>sd_bus_message_append_string_memfd</title>
11     <productname>systemd</productname>
12   </refentryinfo>
14   <refmeta>
15     <refentrytitle>sd_bus_message_append_string_memfd</refentrytitle>
16     <manvolnum>3</manvolnum>
17   </refmeta>
19   <refnamediv>
20     <refname>sd_bus_message_append_string_memfd</refname>
21     <refname>sd_bus_message_append_string_iovec</refname>
22     <refname>sd_bus_message_append_string_space</refname>
24     <refpurpose>Attach a string to a message</refpurpose>
25   </refnamediv>
27   <refsynopsisdiv>
28     <funcsynopsis>
29       <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
31       <funcprototype>
32         <funcdef>int sd_bus_message_append_string_memfd</funcdef>
33         <paramdef>sd_bus_message *<parameter>m</parameter></paramdef>
34         <paramdef>int <parameter>memfd</parameter></paramdef>
35       </funcprototype>
37       <funcprototype>
38         <funcdef>int sd_bus_message_append_string_iovec</funcdef>
39         <paramdef>sd_bus_message *<parameter>m</parameter></paramdef>
40         <paramdef>const struct iovec *<parameter>iov</parameter></paramdef>
41         <paramdef>unsigned <parameter>n</parameter></paramdef>
42       </funcprototype>
44       <funcprototype>
45         <funcdef>int sd_bus_message_append_string_space</funcdef>
46         <paramdef>sd_bus_message *<parameter>m</parameter></paramdef>
47         <paramdef>size_t <parameter>size</parameter></paramdef>
48         <paramdef>char **<parameter>s</parameter></paramdef>
49       </funcprototype>
50     </funcsynopsis>
51   </refsynopsisdiv>
53   <refsect1>
54     <title>Description</title>
56     <para>The functions
57     <function>sd_bus_message_append_string_memfd()</function> and
58     <function>sd_bus_message_append_string_iovec()</function> can be
59     used to append a single string (item of type <literal>s</literal>)
60     to message <parameter>m</parameter>.</para>
62     <para>In case of
63     <function>sd_bus_message_append_string_memfd()</function>, the
64     contents of <parameter>memfd</parameter> are the string. They must
65     satisfy the same constraints as described for the
66     <literal>s</literal> type in
67     <citerefentry><refentrytitle>sd_bus_message_append_basic</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
69     <para>In case of
70     <function>sd_bus_message_append_string_iovec()</function>, the
71     payload of <parameter>iov</parameter> is the string. It must
72     satisfy the same constraints as described for the
73     <literal>s</literal> type in
74     <citerefentry><refentrytitle>sd_bus_message_append_basic</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
76     <para>The <parameter>iov</parameter> argument must point to
77     <parameter>n</parameter> <structname>struct iovec</structname>
78     structures. Each structure may have the
79     <structname>iov_base</structname> field set, in which case the
80     memory pointed to will be copied into the message, or unset, in
81     which case a block of spaces (ASCII 32) of length
82     <structname>iov_len</structname> will be inserted. The
83     memory pointed at by <parameter>iov</parameter> may be changed
84     after this call.</para>
86     <para>The
87     <function>sd_bus_message_append_string_space()</function> function appends
88     space for a string to message <parameter>m</parameter>. It behaves
89     similar to <function>sd_bus_message_append_basic()</function> with
90     type <literal>s</literal>, but instead of copying a string into
91     the message, it returns a pointer to the destination area to
92     the caller in pointer <parameter>p</parameter>. Space for the string
93     of length <parameter>size</parameter> plus the terminating
94     <constant>NUL</constant> is allocated.</para>
95   </refsect1>
97   <refsect1>
98     <title>Return Value</title>
100     <para>On success, those calls return 0 or a positive integer. On failure, they return a negative
101     errno-style error code.</para>
103     <xi:include href="sd_bus_message_append_basic.xml" xpointer="errors" />
104   </refsect1>
106   <xi:include href="libsystemd-pkgconfig.xml" />
108   <refsect1>
109     <title>See Also</title>
111     <para>
112       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
113       <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
114       <citerefentry><refentrytitle>sd_bus_message_append_basic</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
115       <ulink url="https://dbus.freedesktop.org/doc/dbus-specification.html">The D-Bus specification</ulink>
116     </para>
117   </refsect1>
119 </refentry>