#include "bus-introspect.h"
#include "bus-signature.h"
#include "bus-internal.h"
+#include "bus-protocol.h"
int introspect_begin(struct introspect *i) {
assert(i);
if (!i->f)
return -ENOMEM;
- fputs(SD_BUS_INTROSPECT_DOCTYPE
+ fputs(BUS_INTROSPECT_DOCTYPE
"<node>\n", i->f);
return 0;
int introspect_write_default_interfaces(struct introspect *i, bool object_manager) {
assert(i);
- fputs(SD_BUS_INTROSPECT_INTERFACE_PEER
- SD_BUS_INTROSPECT_INTERFACE_INTROSPECTABLE
- SD_BUS_INTROSPECT_INTERFACE_PROPERTIES, i->f);
+ fputs(BUS_INTROSPECT_INTERFACE_PEER
+ BUS_INTROSPECT_INTERFACE_INTROSPECTABLE
+ BUS_INTROSPECT_INTERFACE_PROPERTIES, i->f);
if (object_manager)
- fputs(SD_BUS_INTROSPECT_INTERFACE_OBJECT_MANAGER, i->f);
+ fputs(BUS_INTROSPECT_INTERFACE_OBJECT_MANAGER, i->f);
return 0;
}
if (flags & SD_BUS_VTABLE_DEPRECATED)
fputs(" <annotation name=\"org.freedesktop.DBus.Deprecated\" value=\"true\"/>\n", i->f);
- if (type == _SD_BUS_VTABLE_METHOD && flags & SD_BUS_VTABLE_METHOD_NO_REPLY)
+ if (type == _SD_BUS_VTABLE_METHOD && (flags & SD_BUS_VTABLE_METHOD_NO_REPLY))
fputs(" <annotation name=\"org.freedesktop.DBus.Method.NoReply\" value=\"true\"/>\n", i->f);
if (type == _SD_BUS_VTABLE_PROPERTY || type == _SD_BUS_VTABLE_WRITABLE_PROPERTY) {
else if (flags & SD_BUS_VTABLE_PROPERTY_INVALIDATE_ONLY)
fputs(" <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"invalidates\"/>\n", i->f);
}
+
+ if ((type == _SD_BUS_VTABLE_METHOD || type == _SD_BUS_VTABLE_WRITABLE_PROPERTY) && (flags & SD_BUS_VTABLE_UNPRIVILEGED))
+ fputs(" <annotation name=\"org.freedesktop.systemd1.Unprivileged\" value=\"true\"/>\n", i->f);
}
static int introspect_write_arguments(struct introspect *i, const char *signature, const char *direction) {
for (; v->type != _SD_BUS_VTABLE_END; v++) {
+ if (v->type != _SD_BUS_VTABLE_START && (v->flags & SD_BUS_VTABLE_HIDDEN))
+ continue;
+
switch (v->type) {
case _SD_BUS_VTABLE_START: