X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fdbus-common.h;h=f7f614cdcd4a9e9e6df622c7d3fdcb64bdaf08a5;hb=076a24adf4bfbb9c5aa8167e102c253c7e1c651e;hp=005a715d0aa6ae4dc59184d9a987c327b901eac4;hpb=6d0274f11547a0f11200bb82bf598a5a253e12cf;p=elogind.git diff --git a/src/shared/dbus-common.h b/src/shared/dbus-common.h index 005a715d0..f7f614cdc 100644 --- a/src/shared/dbus-common.h +++ b/src/shared/dbus-common.h @@ -23,6 +23,7 @@ #include #include +#include #ifndef DBUS_ERROR_UNKNOWN_OBJECT #define DBUS_ERROR_UNKNOWN_OBJECT "org.freedesktop.DBus.Error.UnknownObject" @@ -113,6 +114,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, @@ -192,6 +197,22 @@ unsigned bus_events_to_flags(uint32_t events); int bus_parse_strv(DBusMessage *m, char ***_l); int bus_parse_strv_iter(DBusMessageIter *iter, char ***_l); +int bus_parse_strv_pairs_iter(DBusMessageIter *iter, char ***_l); + +struct unit_info { + const char *id; + const char *description; + const char *load_state; + const char *active_state; + const char *sub_state; + const char *following; + const char *unit_path; + uint32_t job_id; + const char *job_type; + const char *job_path; +}; + +int bus_parse_unit_info(DBusMessageIter *iter, struct unit_info *u); int bus_append_strv_iter(DBusMessageIter *iter, char **l); @@ -220,3 +241,4 @@ 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)))