chiark / gitweb /
dbus: automatically generate and install introspection files
[elogind.git] / src / dbus-job.c
index 34e64fc6812e457de3b36255956a6efdea230a0a..7346252a18a965168c8e660565d25af9dfb6c8e2 100644 (file)
 #include "log.h"
 #include "dbus-job.h"
 
-static const char introspection[] =
-        DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
-        "<node>"
-        " <interface name=\"org.freedesktop.systemd1.Job\">"
-        "  <method name=\"Cancel\"/>"
-        "  <signal name=\"Changed\"/>"
-        "  <property name=\"Id\" type=\"u\" access=\"read\"/>"
-        "  <property name=\"Unit\" type=\"(so)\" access=\"read\"/>"
-        "  <property name=\"JobType\" type=\"s\" access=\"read\"/>"
-        "  <property name=\"State\" type=\"s\" access=\"read\"/>"
-        " </interface>"
-        BUS_PROPERTIES_INTERFACE
-        BUS_INTROSPECTABLE_INTERFACE
-        "</node>";
+#define BUS_JOB_INTERFACE                                             \
+        " <interface name=\"org.freedesktop.systemd1.Job\">\n"        \
+        "  <method name=\"Cancel\"/>\n"                               \
+        "  <signal name=\"Changed\"/>\n"                              \
+        "  <property name=\"Id\" type=\"u\" access=\"read\"/>\n"      \
+        "  <property name=\"Unit\" type=\"(so)\" access=\"read\"/>\n" \
+        "  <property name=\"JobType\" type=\"s\" access=\"read\"/>\n" \
+        "  <property name=\"State\" type=\"s\" access=\"read\"/>\n"   \
+        " </interface>\n"
+
+#define INTROSPECTION                                                 \
+        DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE                     \
+        "<node>\n"                                                    \
+        BUS_JOB_INTERFACE                                             \
+        BUS_PROPERTIES_INTERFACE                                      \
+        BUS_INTROSPECTABLE_INTERFACE                                  \
+        "</node>\n"
+
+const char bus_job_interface[] = BUS_JOB_INTERFACE;
 
 static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_job_append_state, job_state, JobState);
 static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_job_append_type, job_type, JobType);
@@ -92,7 +97,7 @@ static DBusHandlerResult bus_job_message_dispatch(Job *j, DBusMessage *message)
                 job_free(j);
 
         } else
-                return bus_default_message_handler(j->manager, message, introspection, properties);
+                return bus_default_message_handler(j->manager, message, INTROSPECTION, properties);
 
         if (reply) {
                 if (!dbus_connection_send(m->api_bus, reply, NULL))