1SD_BUS_MESSAGE_GET_TYPE(3)  sd_bus_message_get_type SD_BUS_MESSAGE_GET_TYPE(3)
2
3
4

NAME

6       sd_bus_message_get_type, sd_bus_message_is_signal,
7       sd_bus_message_is_method_call, sd_bus_message_is_method_error - Query
8       bus message addressing metadata
9

SYNOPSIS

11       #include <systemd/sd-bus.h>
12
13       int sd_bus_message_get_type(sd_bus_message *message, uint8_t *type);
14
15       int sd_bus_message_is_signal(sd_bus_message *message,
16                                    const char *interface,
17                                    const char *member);
18
19       int sd_bus_message_is_method_call(sd_bus_message *message,
20                                         const char *interface,
21                                         const char *member);
22
23       int sd_bus_message_is_method_error(sd_bus_message *message,
24                                          const char *name);
25

DESCRIPTION

27       sd_bus_message_get_type() returns the type of a message in the output
28       parameter type, one of SD_BUS_MESSAGE_METHOD_CALL,
29       SD_BUS_MESSAGE_METHOD_RETURN, SD_BUS_MESSAGE_METHOD_ERROR,
30       SD_BUS_MESSAGE_SIGNAL. This type is either specified as a parameter
31       when the message is created using sd_bus_set_message_new(3), or is set
32       automatically when the message is created using
33       sd_bus_set_message_new_signal(3),
34       sd_bus_set_message_new_method_call(3),
35       sd_bus_set_message_new_method_error(3) and similar functions.
36
37       sd_bus_message_is_signal() checks if message m is a signal message. If
38       interface is non-null, it also checks if the message has the same
39       interface set. If member is non-null, it also checks if the message has
40       the same member set. Also see sd_bus_set_message_new_signal(3). It
41       returns true when all checks pass.
42
43       sd_bus_message_is_method_call() checks if message m is a method call
44       message. If interface is non-null, it also checks if the message has
45       the same interface set. If member is non-null, it also checks if the
46       message has the same member set. Also see
47       sd_bus_set_message_new_method_call(3). It returns true when all checks
48       pass.
49
50       sd_bus_message_is_method_error() checks if message m is an error reply
51       message. If name is non-null, it also checks if the message has the
52       same error identifier set. Also see
53       sd_bus_set_message_new_method_error(3). It returns true when all checks
54       pass.
55

RETURN VALUE

57       On success, those functions return 0 or a positive integer. On failure,
58       it returns a negative errno-style error code.
59
60   Errors
61       Returned errors may indicate the following problems:
62
63       -EINVAL
64           The message parameter or the output parameter are NULL.
65

NOTES

67       These APIs are implemented as a shared library, which can be compiled
68       and linked to with the libsystemd pkg-config(1) file.
69

SEE ALSO

71       systemd(1), sd-bus(3), sd_bus_message_new(3),
72       sd_bus_message_set_destination(3)
73
74
75
76systemd 245                                         SD_BUS_MESSAGE_GET_TYPE(3)
Impressum