1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
10 typedef int (*BusPropertyCallback
)(Manager
*m
, DBusMessageIter
*iter
, const char *property
, void *data
);
12 typedef struct BusProperty
{
13 const char *interface
; /* interface of the property */
14 const char *property
; /* name of the property */
15 BusPropertyCallback append
; /* Function that is called to serialize this property */
16 const char *signature
;
17 void *data
; /* The data of this property */
20 #define BUS_PROPERTIES_INTERFACE \
21 " <interface name=\"org.freedesktop.DBus.Properties\">" \
22 " <method name=\"Get\">" \
23 " <arg name=\"interface\" direction=\"in\" type=\"s\"/>" \
24 " <arg name=\"property\" direction=\"in\" type=\"s\"/>" \
25 " <arg name=\"value\" direction=\"out\" type=\"v\"/>" \
27 " <method name=\"GetAll\">" \
28 " <arg name=\"interface\" direction=\"in\" type=\"s\"/>" \
29 " <arg name=\"properties\" direction=\"out\" type=\"a{sv}\"/>" \
33 #define BUS_INTROSPECTABLE_INTERFACE \
34 " <interface name=\"org.freedesktop.DBus.Introspectable\">" \
35 " <method name=\"Introspect\">" \
36 " <arg name=\"data\" type=\"s\" direction=\"out\"/>" \
40 int bus_init(Manager
*m
);
41 void bus_done(Manager
*m
);
43 void bus_dispatch(Manager
*m
);
45 void bus_watch_event(Manager
*m
, Watch
*w
, int events
);
46 void bus_timeout_event(Manager
*m
, Watch
*w
, int events
);
48 DBusHandlerResult
bus_default_message_handler(Manager
*m
, DBusMessage
*message
, const char* introspection
, const BusProperty
*properties
);
50 DBusHandlerResult
bus_send_error_reply(Manager
*m
, DBusMessage
*message
, DBusError
*bus_error
, int error
);
52 int bus_property_append_string(Manager
*m
, DBusMessageIter
*i
, const char *property
, void *data
);
53 int bus_property_append_strv(Manager
*m
, DBusMessageIter
*i
, const char *property
, void *data
);
54 int bus_property_append_bool(Manager
*m
, DBusMessageIter
*i
, const char *property
, void *data
);
55 int bus_property_append_uint32(Manager
*m
, DBusMessageIter
*i
, const char *property
, void *data
);
56 int bus_property_append_uint64(Manager
*m
, DBusMessageIter
*i
, const char *property
, void *data
);
58 extern const DBusObjectPathVTable bus_manager_vtable
;
59 extern const DBusObjectPathVTable bus_job_vtable
;
60 extern const DBusObjectPathVTable bus_unit_vtable
;