summaryrefslogtreecommitdiff
path: root/src/dbus-service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-05-23 03:45:33 +0200
committerLennart Poettering <lennart@poettering.net>2010-05-23 03:45:33 +0200
commit4288f619215e3dda0b75113d78e4fb7ba219ed58 (patch)
treef7e3c8d3d710ae29bcb1313323a843ea1e375d89 /src/dbus-service.c
parent6d526de26737a0f1e8d1cf422da364d29489022e (diff)
dbus: automatically generate and install introspection files
Diffstat (limited to 'src/dbus-service.c')
-rw-r--r--src/dbus-service.c53
1 files changed, 29 insertions, 24 deletions
diff --git a/src/dbus-service.c b/src/dbus-service.c
index 24dd6c14f6..6286172a1b 100644
--- a/src/dbus-service.c
+++ b/src/dbus-service.c
@@ -25,29 +25,34 @@
#include "dbus-execute.h"
#include "dbus-service.h"
-static const char introspection[] =
- DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
- "<node>"
- BUS_UNIT_INTERFACE
- BUS_PROPERTIES_INTERFACE
- " <interface name=\"org.freedesktop.systemd1.Service\">"
- " <property name=\"Type\" type=\"s\" access=\"read\"/>"
- " <property name=\"Restart\" type=\"s\" access=\"read\"/>"
- " <property name=\"PIDFile\" type=\"s\" access=\"read\"/>"
- " <property name=\"RestartUSec\" type=\"t\" access=\"read\"/>"
- " <property name=\"TimeoutUSec\" type=\"t\" access=\"read\"/>"
- BUS_EXEC_CONTEXT_INTERFACE
- " <property name=\"PermissionsStartOnly\" type=\"b\" access=\"read\"/>"
- " <property name=\"RootDirectoryStartOnly\" type=\"b\" access=\"read\"/>"
- " <property name=\"ValidNoProcess\" type=\"b\" access=\"read\"/>"
- " <property name=\"KillMode\" type=\"s\" access=\"read\"/>"
- " <property name=\"MainPID\" type=\"u\" access=\"read\"/>"
- " <property name=\"ControlPID\" type=\"u\" access=\"read\"/>"
- " <property name=\"SysVPath\" type=\"s\" access=\"read\"/>"
- " <property name=\"BusName\" type=\"s\" access=\"read\"/>"
- " </interface>"
- BUS_INTROSPECTABLE_INTERFACE
- "</node>";
+#define BUS_SERVICE_INTERFACE \
+ " <interface name=\"org.freedesktop.systemd1.Service\">\n" \
+ " <property name=\"Type\" type=\"s\" access=\"read\"/>\n" \
+ " <property name=\"Restart\" type=\"s\" access=\"read\"/>\n" \
+ " <property name=\"PIDFile\" type=\"s\" access=\"read\"/>\n" \
+ " <property name=\"RestartUSec\" type=\"t\" access=\"read\"/>\n" \
+ " <property name=\"TimeoutUSec\" type=\"t\" access=\"read\"/>\n" \
+ BUS_EXEC_CONTEXT_INTERFACE \
+ " <property name=\"PermissionsStartOnly\" type=\"b\" access=\"read\"/>\n" \
+ " <property name=\"RootDirectoryStartOnly\" type=\"b\" access=\"read\"/>\n" \
+ " <property name=\"ValidNoProcess\" type=\"b\" access=\"read\"/>\n" \
+ " <property name=\"KillMode\" type=\"s\" access=\"read\"/>\n" \
+ " <property name=\"MainPID\" type=\"u\" access=\"read\"/>\n" \
+ " <property name=\"ControlPID\" type=\"u\" access=\"read\"/>\n" \
+ " <property name=\"SysVPath\" type=\"s\" access=\"read\"/>\n" \
+ " <property name=\"BusName\" type=\"s\" access=\"read\"/>\n" \
+ " </interface>\n"
+
+#define INTROSPECTION \
+ DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
+ "<node>\n" \
+ BUS_UNIT_INTERFACE \
+ BUS_SERVICE_INTERFACE \
+ BUS_PROPERTIES_INTERFACE \
+ BUS_INTROSPECTABLE_INTERFACE \
+ "</node>\n"
+
+const char bus_service_interface[] = BUS_SERVICE_INTERFACE;
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_service_append_type, service_type, ServiceType);
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_service_append_restart, service_restart, ServiceRestart);
@@ -74,5 +79,5 @@ DBusHandlerResult bus_service_message_handler(Unit *u, DBusMessage *message) {
{ NULL, NULL, NULL, NULL, NULL }
};
- return bus_default_message_handler(u->meta.manager, message, introspection, properties);
+ return bus_default_message_handler(u->meta.manager, message, INTROSPECTION, properties);
}