1SD_BUS_MESSAGE_DUMP(3)        sd_bus_message_dump       SD_BUS_MESSAGE_DUMP(3)
2
3
4

NAME

6       sd_bus_message_dump - Produce a string representation of a message for
7       debugging purposes
8

SYNOPSIS

10       #include <systemd/sd-bus.h>
11
12       int sd_bus_message_dump(sd_bus_message *m, FILE *f, uint64_t flags);
13
14       SD_BUS_MESSAGE_DUMP_WITH_HEADER, SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY
15

DESCRIPTION

17       The sd_bus_message_dump() function writes a textual representation of
18       the message m to the stream f. If f is NULL, standard output (stdio)
19       will be used. This function is intended to be used for debugging
20       purposes, and the output is neither stable nor designed to be machine
21       readable.
22
23       The flags parameter may be used to modify the output. With
24       SD_BUS_MESSAGE_DUMP_WITH_HEADER, a header that specifies the message
25       type and flags and some additional metadata is printed. When
26       SD_BUS_MESSAGE_DUMP_SUBTREE_ONLY is not passed, the contents of the
27       whole message are printed. When it is passed, only the current
28       container in printed.
29
30       Note that this function moves the read pointer of the message. It may
31       be necessary to reset the position afterwards, for example with
32       sd_bus_message_rewind(3).
33

EXAMPLES

35       Output for a signal message (with SD_BUS_MESSAGE_DUMP_WITH_HEADER):
36
37           > Type=signal  Endian=l  Flags=1  Version=1  Cookie=22
38             Path=/value/a  Interface=org.freedesktop.DBus.Properties  Member=PropertiesChanged
39             MESSAGE "sa{sv}as" {
40                     STRING "org.freedesktop.systemd.ValueTest";
41                     ARRAY "{sv}" {
42                             DICT_ENTRY "sv" {
43                                     STRING "Value";
44                                     VARIANT "s" {
45                                             STRING "object 0x1e, path /value/a";
46                                     };
47                             };
48                     };
49                     ARRAY "s" {
50                             STRING "Value2";
51                             STRING "AnExplicitProperty";
52                     };
53             };
54
55
56

RETURN VALUE

58       On success, this function returns 0 or a positive integer. On failure,
59       it returns a negative errno-style error code. No error codes are
60       currently defined.
61

NOTES

63       Functions described here are available as a shared library, which can
64       be compiled against and linked to with the libsystemd pkg-config(1)
65       file.
66
67       The code described here uses getenv(3), which is declared to be not
68       multi-thread-safe. This means that the code calling the functions
69       described here must not call setenv(3) from a parallel thread. It is
70       recommended to only do calls to setenv() from an early phase of the
71       program when no other threads have been started.
72

SEE ALSO

74       systemd(1), sd-bus(3)
75
76
77
78systemd 254                                             SD_BUS_MESSAGE_DUMP(3)
Impressum