X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fdbus-common.h;h=a9a4dcca6b9738c4d1aa622a3747f4588e19ce05;hb=e42e801b55740df1e2007336c8e2cb1e538849e1;hp=a6703a78d06da2305830806de0f7237ba54cb72b;hpb=c2f1db8f83618e60dcded8303d14656d7d26b436;p=elogind.git diff --git a/src/shared/dbus-common.h b/src/shared/dbus-common.h index a6703a78d..a9a4dcca6 100644 --- a/src/shared/dbus-common.h +++ b/src/shared/dbus-common.h @@ -22,6 +22,7 @@ ***/ #include +#include #ifndef DBUS_ERROR_UNKNOWN_OBJECT #define DBUS_ERROR_UNKNOWN_OBJECT "org.freedesktop.DBus.Error.UnknownObject" @@ -112,6 +113,10 @@ typedef struct BusBoundProperties { const void *const base; /* base pointer to which the offset must be added to reach data */ } BusBoundProperties; +dbus_bool_t bus_maybe_send_reply (DBusConnection *c, + DBusMessage *message, + DBusMessage *reply); + DBusHandlerResult bus_send_error_reply( DBusConnection *c, DBusMessage *message, @@ -203,3 +208,20 @@ void bus_async_unregister_and_exit(DBusConnection *bus, const char *name); DBusHandlerResult bus_exit_idle_filter(DBusConnection *bus, DBusMessage *m, void *userdata); pid_t bus_get_unix_process_id(DBusConnection *connection, const char *name, DBusError *error); + +bool bus_error_is_no_service(const DBusError *error); +int bus_method_call_with_reply(DBusConnection *bus, + const char *destination, + const char *path, + const char *interface, + const char *method, + DBusMessage **return_reply, + DBusError *return_error, + int first_arg_type, ...); + +const char *bus_message_get_sender_with_fallback(DBusMessage *m); + +void bus_message_unrefp(DBusMessage **reply); + +#define _cleanup_dbus_message_unref_ __attribute__((cleanup(bus_message_unrefp))) +#define _cleanup_dbus_error_free_ __attribute__((cleanup(dbus_error_free)))