1:255.13-alt1
[systemd_ALT.git] / man / sd_bus_message_dump.xml
blob83a4a4e31ab46f81eef9dbdb9c1ee8a81d5fbb39
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_dump"
7           xmlns:xi="http://www.w3.org/2001/XInclude">
9   <refentryinfo>
10     <title>sd_bus_message_dump</title>
11     <productname>systemd</productname>
12   </refentryinfo>
14   <refmeta>
15     <refentrytitle>sd_bus_message_dump</refentrytitle>
16     <manvolnum>3</manvolnum>
17   </refmeta>
19   <refnamediv>
20     <refname>sd_bus_message_dump</refname>
22     <refpurpose>Produce a string representation of a message for debugging purposes</refpurpose>
23   </refnamediv>
25   <refsynopsisdiv>
26     <funcsynopsis>
27       <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
29       <funcprototype>
30         <funcdef>int sd_bus_message_dump</funcdef>
31         <paramdef>sd_bus_message *<parameter>m</parameter></paramdef>
32         <paramdef>FILE *<parameter>f</parameter></paramdef>
33         <paramdef>uint64_t <parameter>flags</parameter></paramdef>
34       </funcprototype>
35     </funcsynopsis>
37     <para>
38       <constant>SD_BUS_MESSAGE_DUMP_WITH_HEADER</constant>,
39       <constant>SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY</constant>
40     </para>
41   </refsynopsisdiv>
43   <refsect1>
44     <title>Description</title>
46     <para>The <function>sd_bus_message_dump()</function> function writes a textual representation of the
47     message <parameter>m</parameter> to the stream <parameter>f</parameter>. If <parameter>f</parameter> is
48     <constant>NULL</constant>, standard output (<constant>stdio</constant>) will be used. This function is
49     intended to be used for debugging purposes, and the output is neither stable nor designed to be machine
50     readable.</para>
52     <para>The <parameter>flags</parameter> parameter may be used to modify the output. With
53     <constant>SD_BUS_MESSAGE_DUMP_WITH_HEADER</constant>, a header that specifies the message type and flags
54     and some additional metadata is printed. When <constant>SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY</constant> is
55     not passed, the contents of the whole message are printed. When it <emphasis>is</emphasis> passed,
56     only the current container in printed.</para>
58     <para>Note that this function moves the read pointer of the message. It may be necessary to reset the
59     position afterwards, for example with
60     <citerefentry><refentrytitle>sd_bus_message_rewind</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
61     </para>
62   </refsect1>
64   <refsect1>
65     <title>Examples</title>
67     <para>Output for a signal message (with <constant>SD_BUS_MESSAGE_DUMP_WITH_HEADER</constant>):
68     <programlisting>
69 ‣ Type=signal  Endian=l  Flags=1  Version=1  Cookie=22
70   Path=/value/a  Interface=org.freedesktop.DBus.Properties  Member=PropertiesChanged
71   MESSAGE "sa{sv}as" {
72           STRING "org.freedesktop.systemd.ValueTest";
73           ARRAY "{sv}" {
74                   DICT_ENTRY "sv" {
75                           STRING "Value";
76                           VARIANT "s" {
77                                   STRING "object 0x1e, path /value/a";
78                           };
79                   };
80           };
81           ARRAY "s" {
82                   STRING "Value2";
83                   STRING "AnExplicitProperty";
84           };
85   };
86     </programlisting>
87     </para>
88   </refsect1>
90   <refsect1>
91     <title>Return Value</title>
93     <para>On success, this function returns 0 or a positive integer. On failure, it returns a negative
94     errno-style error code. No error codes are currently defined.</para>
95   </refsect1>
97   <xi:include href="libsystemd-pkgconfig.xml" />
99   <refsect1>
100     <title>See Also</title>
102     <para>
103       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
104       <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>
105     </para>
106   </refsect1>
108 </refentry>