man-pages/man3/sd_bus_message_dump.3.html
2021-03-31 01:06:50 +01:00

157 lines
3.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SD_BUS_MESSAGE_DUMP</TITLE>
</HEAD><BODY>
<H1>SD_BUS_MESSAGE_DUMP</H1>
Section: sd_bus_message_dump (3)<BR>Updated: <BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
sd_bus_message_dump - Produce a string representation of a message for debugging purposes
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<B>
</B><PRE>
#include &lt;<A HREF="file:///usr/include/systemd/sd-bus.h">systemd/sd-bus.h</A>&gt;
</PRE>
<DL COMPACT>
<DT id="1">
<B>int sd_bus_message_dump(sd_bus_message&nbsp;*</B><I>m</I><B>, FILE&nbsp;*</B><I>f</I><B>, uint64_t&nbsp;</B><I>flags</I><B>);</B>
</DL>
<P>
<B>SD_BUS_MESSAGE_DUMP_WITH_HEADER</B>,
<B>SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY</B>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
<DD>The
<B>sd_bus_message_dump()</B>
function writes a textual representation of the message
<I>m</I>
to the stream
<I>f</I>. This function is intended to be used for debugging purposes, and the output is neither stable nor designed to be machine readable.
<P>
The
<I>flags</I>
parameter may be used to modify the output. With
<B>SD_BUS_MESSAGE_DUMP_WITH_HEADER</B>, a header that specifies the message type and flags and some additional metadata is printed. When
<B>SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY</B>
is not passed, the contents of the whole message are printed. When it
<I>is</I>
passed, only the current container in printed.
<P>
Note that this function moves the read pointer of the message. It may be necessary to reset the position afterwards, for example with
<B><A HREF="/cgi-bin/man/man2html?3+sd_bus_message_rewind">sd_bus_message_rewind</A></B>(3).
<A NAME="lbAE">&nbsp;</A>
<H2>EXAMPLES</H2>
<P>
Output for a signal message (with
<B>SD_BUS_MESSAGE_DUMP_WITH_HEADER</B>):
<P>
<DL COMPACT><DT id="2"><DD>
<PRE>
&gt; Type=signal Endian=l Flags=1 Version=1 Priority=0 Cookie=22
Path=/value/a Interface=org.freedesktop.DBus.Properties Member=PropertiesChanged
MESSAGE &quot;sa{sv}as&quot; {
STRING &quot;org.freedesktop.systemd.ValueTest&quot;;
ARRAY &quot;{sv}&quot; {
DICT_ENTRY &quot;sv&quot; {
STRING &quot;Value&quot;;
VARIANT &quot;s&quot; {
STRING &quot;object 0x1e, path /value/a&quot;;
};
};
};
ARRAY &quot;s&quot; {
STRING &quot;Value2&quot;;
STRING &quot;AnExplicitProperty&quot;;
};
};
</PRE>
</DL>
<P>
<A NAME="lbAF">&nbsp;</A>
<H2>RETURN VALUE</H2>
<P>
On success, this function returns 0 or a positive integer. On failure, it returns a negative errno-style error code. No error codes are currently defined.
<A NAME="lbAG">&nbsp;</A>
<H2>NOTES</H2>
<P>
These APIs are implemented as a shared library, which can be compiled and linked to with the
<B>libsystemd</B>&nbsp;<B><A HREF="/cgi-bin/man/man2html?1+pkg-config">pkg-config</A></B>(1)
file.
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<P>
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?3+sd-bus">sd-bus</A></B>(3)
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="3"><A HREF="#lbAB">NAME</A><DD>
<DT id="4"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="5"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="6"><A HREF="#lbAE">EXAMPLES</A><DD>
<DT id="7"><A HREF="#lbAF">RETURN VALUE</A><DD>
<DT id="8"><A HREF="#lbAG">NOTES</A><DD>
<DT id="9"><A HREF="#lbAH">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:54 GMT, March 31, 2021
</BODY>
</HTML>