1:255.16-alt1
[systemd_ALT.git] / man / sd_bus_message_copy.xml
blob278bc354596ab4a86078941e2c6d8410d0657057
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_copy" xmlns:xi="http://www.w3.org/2001/XInclude">
8   <refentryinfo>
9     <title>sd_bus_message_copy</title>
10     <productname>systemd</productname>
11   </refentryinfo>
13   <refmeta>
14     <refentrytitle>sd_bus_message_copy</refentrytitle>
15     <manvolnum>3</manvolnum>
16   </refmeta>
18   <refnamediv>
19     <refname>sd_bus_message_copy</refname>
21     <refpurpose>Copy the contents of one message to another</refpurpose>
22   </refnamediv>
24   <refsynopsisdiv>
25     <funcsynopsis>
26       <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
28       <funcprototype>
29         <funcdef>int sd_bus_message_copy</funcdef>
30         <paramdef>sd_bus_message *<parameter>m</parameter></paramdef>
31         <paramdef>sd_bus_message *<parameter>source</parameter></paramdef>
32         <paramdef>int <parameter>all</parameter></paramdef>
33       </funcprototype>
34     </funcsynopsis>
35   </refsynopsisdiv>
37   <refsect1>
38     <title>Description</title>
40     <para><function>sd_bus_message_copy()</function> copies the contents from
41     message <parameter>source</parameter> to <parameter>m</parameter>. If
42     <parameter>all</parameter> is false, a single complete type is copied
43     (basic or container). If <parameter>all</parameter> is true, the contents
44     are copied until the end of the currently open container or the end
45     of <parameter>source</parameter>.</para>
46   </refsect1>
48   <refsect1>
49     <title>Return Value</title>
51     <para>On success, this call returns true if anything was copied, and false if
52     there was nothing to copy. On failure, it returns a negative errno-style error
53     code.</para>
55     <refsect2 id='errors'>
56       <title>Errors</title>
58       <para>Returned errors may indicate the following problems:</para>
60       <variablelist>
62         <varlistentry>
63           <term><constant>-EINVAL</constant></term>
65           <listitem><para><parameter>source</parameter> or <parameter>m</parameter> are
66           <constant>NULL</constant>.</para></listitem>
67         </varlistentry>
69         <varlistentry>
70           <term><constant>-EPERM</constant></term>
72           <listitem><para>Message <parameter>m</parameter> has been sealed or <parameter>source</parameter>
73           has <emphasis>not</emphasis> been sealed.  </para></listitem>
74         </varlistentry>
76         <varlistentry>
77           <term><constant>-ESTALE</constant></term>
79           <listitem><para>Destination message is in invalid state.
80           </para></listitem>
81         </varlistentry>
83         <varlistentry>
84           <term><constant>-ENXIO</constant></term>
86           <listitem><para>Destination message cannot be appended to.
87           </para></listitem>
88         </varlistentry>
90         <varlistentry>
91           <term><constant>-ENOMEM</constant></term>
93           <listitem><para>Memory allocation failed.</para></listitem>
94         </varlistentry>
95       </variablelist>
96     </refsect2>
97   </refsect1>
99   <xi:include href="libsystemd-pkgconfig.xml" />
101   <refsect1>
102     <title>See Also</title>
104     <para>
105       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
106       <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
107       <citerefentry><refentrytitle>sd_bus_message_append</refentrytitle><manvolnum>3</manvolnum></citerefentry>
108     </para>
109   </refsect1>
111 </refentry>