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