chiark / gitweb /
dbus: import struct unit_info from systemctl
[elogind.git] / src / shared / dbus-common.h
index 3b7ae16934546193af550307249407dc6d2ce24c..800c0ea23a4939f22236b3b23e684753cb470449 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <dbus/dbus.h>
 #include <inttypes.h>
+#include <sys/types.h>
 
 #ifndef DBUS_ERROR_UNKNOWN_OBJECT
 #define DBUS_ERROR_UNKNOWN_OBJECT "org.freedesktop.DBus.Error.UnknownObject"
@@ -196,6 +197,20 @@ 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_append_strv_iter(DBusMessageIter *iter, char **l);
 
@@ -224,3 +239,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)))