SD_BUS_MESSAGE_GET_TYPE(3)

  .SH "NAME" sd_bus_message_get_type, sd_bus_message_is_signal, sd_bus_message_is_method_call, sd_bus_message_is_method_error - Query bus message addressing metadata
  .SH "SYNOPSIS"

#include <systemd/sd-bus.h>

      .HP u int sd_bus_message_get_type(sd_bus_message *message, uint8_t *type);
      .HP u int sd_bus_message_is_signal(sd_bus_message *message, const char *interface, const char *member);
      .HP u int sd_bus_message_is_method_call(sd_bus_message *message, const char *interface, const char *member);
      .HP u int sd_bus_message_is_method_error(sd_bus_message *message, const char *name);

  .SH "DESCRIPTION"

    .PP sd_bus_message_get_type() returns the type of a message in the output parameter type, one of SD_BUS_MESSAGE_METHOD_CALL, SD_BUS_MESSAGE_METHOD_RETURN, SD_BUS_MESSAGE_METHOD_ERROR, SD_BUS_MESSAGE_SIGNAL. This type is either specified as a parameter when the message is created using sd_bus_set_message_new(3), or is set automatically when the message is created using sd_bus_set_message_new_signal(3), sd_bus_set_message_new_method_call(3), sd_bus_set_message_new_method_error(3) and similar functions.
    .PP sd_bus_message_is_signal() checks if message m is a signal message. If interface is non-null, it also checks if the message has the same interface set. If member is non-null, it also checks if the message has the same member set. Also see sd_bus_set_message_new_signal(3). It returns true when all checks pass.
    .PP sd_bus_message_is_method_call() checks if message m is a method call message. If interface is non-null, it also checks if the message has the same interface set. If member is non-null, it also checks if the message has the same member set. Also see sd_bus_set_message_new_method_call(3). It returns true when all checks pass.
    .PP sd_bus_message_is_method_error() checks if message m is an error reply message. If name is non-null, it also checks if the message has the same error identifier set. Also see sd_bus_set_message_new_method_error(3). It returns true when all checks pass.
  .SH "RETURN VALUE"

    .PP On success, those functions return 0 or a positive integer. On failure, it returns a negative errno-style error code.

  .SH "ERRORS"

    .PP Returned errors may indicate the following problems:

      .PP -EINVAL

            The message parameter or the output parameter are NULL.
          .RE

      .SH "NOTES"

      .PP These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) file.
      .SH "SEE ALSO"

        .PP systemd(1), sd-bus(3), sd_bus_message_new(3), sd_bus_message_set_destination(3)