]>
Commit | Line | Data |
---|---|---|
c5fd8c39 ZJS |
1 | <?xml version='1.0'?> |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | |
4 | ||
5 | <!-- | |
6 | SPDX-License-Identifier: LGPL-2.1+ | |
7 | --> | |
8 | ||
9 | <refentry id="sd_bus_message_copy" xmlns:xi="http://www.w3.org/2001/XInclude"> | |
10 | ||
11 | <refentryinfo> | |
12 | <title>sd_bus_message_copy</title> | |
13 | <productname>systemd</productname> | |
14 | </refentryinfo> | |
15 | ||
16 | <refmeta> | |
17 | <refentrytitle>sd_bus_message_copy</refentrytitle> | |
18 | <manvolnum>3</manvolnum> | |
19 | </refmeta> | |
20 | ||
21 | <refnamediv> | |
22 | <refname>sd_bus_message_copy</refname> | |
23 | ||
24 | <refpurpose>Copy the contents of one message to another</refpurpose> | |
25 | </refnamediv> | |
26 | ||
27 | <refsynopsisdiv> | |
28 | <funcsynopsis> | |
29 | <funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo> | |
30 | ||
31 | <funcprototype> | |
32 | <funcdef>int sd_bus_message_copy</funcdef> | |
33 | <paramdef>sd_bus_message *<parameter>m</parameter></paramdef> | |
34 | <paramdef>sd_bus_message *<parameter>source</parameter></paramdef> | |
35 | <paramdef>int <parameter>all</parameter></paramdef> | |
36 | </funcprototype> | |
37 | </funcsynopsis> | |
38 | </refsynopsisdiv> | |
39 | ||
40 | <refsect1> | |
41 | <title>Description</title> | |
42 | ||
43 | <para><function>sd_bus_message_copy()</function> copies the contents from | |
44 | message <parameter>source</parameter> to <parameter>m</parameter>. If | |
45 | <parameter>all</parameter> is false, a single complete type is copied | |
46 | (basic or container). If <parameter>all</parameter> is true, the contents | |
47 | are copied until the end of the currently open container or the end | |
48 | of <parameter>source</parameter>.</para> | |
49 | </refsect1> | |
50 | ||
51 | <refsect1> | |
52 | <title>Return Value</title> | |
53 | ||
54 | <para>On success, this call returns true if anything was copied, and false if | |
55 | there was nothing to copy. On failure, it returns a negative errno-style error | |
56 | code.</para> | |
57 | </refsect1> | |
58 | ||
59 | <refsect1 id='errors'> | |
60 | <title>Errors</title> | |
61 | ||
62 | <para>Returned errors may indicate the following problems:</para> | |
63 | ||
64 | <variablelist> | |
65 | ||
66 | <varlistentry> | |
67 | <term><constant>-EINVAL</constant></term> | |
68 | ||
69 | <listitem><para><parameter>source</parameter> or <parameter>m</parameter> are | |
70 | <constant>NULL</constant>.</para></listitem> | |
71 | </varlistentry> | |
72 | ||
73 | <varlistentry> | |
74 | <term><constant>-EPERM</constant></term> | |
75 | ||
76 | <listitem><para>Message <parameter>m</parameter> has been sealed or | |
77 | <parameter>source</parameter> has <emphasis>not</emphasis> been sealed. | |
78 | </para></listitem> | |
79 | </varlistentry> | |
80 | ||
81 | <varlistentry> | |
82 | <term><constant>-ESTALE</constant></term> | |
83 | ||
84 | <listitem><para>Destination message is in invalid state. | |
85 | </para></listitem> | |
86 | </varlistentry> | |
87 | ||
88 | <varlistentry> | |
89 | <term><constant>-ENXIO</constant></term> | |
90 | ||
91 | <listitem><para>Destination message cannot be appended to. | |
92 | </para></listitem> | |
93 | </varlistentry> | |
94 | ||
95 | <varlistentry> | |
96 | <term><constant>-ENOMEM</constant></term> | |
97 | ||
98 | <listitem><para>Memory allocation failed.</para></listitem> | |
99 | </varlistentry> | |
100 | </variablelist> | |
101 | </refsect1> | |
102 | ||
103 | <xi:include href="libsystemd-pkgconfig.xml" /> | |
104 | ||
105 | <refsect1> | |
106 | <title>See Also</title> | |
107 | ||
108 | <para> | |
109 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
110 | <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
111 | <citerefentry><refentrytitle>sd_bus_message_append</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
112 | </para> | |
113 | </refsect1> | |
114 | ||
115 | </refentry> |