1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__SERVICES_PCMK_DBUS__H
11 #define PCMK__SERVICES_PCMK_DBUS__H
12
13 #include <stdbool.h>
14
15 #include <dbus/dbus.h>
16 #include <glib.h>
17
18 #ifndef DBUS_TIMEOUT_USE_DEFAULT
19 #define DBUS_TIMEOUT_USE_DEFAULT -1
20 #endif
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 G_GNUC_INTERNAL
27 DBusConnection *pcmk_dbus_connect(void);
28
29 G_GNUC_INTERNAL
30 void pcmk_dbus_disconnect(DBusConnection *connection);
31
32 G_GNUC_INTERNAL
33 DBusPendingCall *pcmk_dbus_send(DBusMessage *msg, DBusConnection *connection,
34 void(*done)(DBusPendingCall *pending, void *user_data), void *user_data, int timeout);
35
36 G_GNUC_INTERNAL
37 DBusMessage *pcmk_dbus_send_recv(DBusMessage *msg, DBusConnection *connection, DBusError *error, int timeout);
38
39 G_GNUC_INTERNAL
40 bool pcmk_dbus_type_check(DBusMessage *msg, DBusMessageIter *field, int expected, const char *function, int line);
41
42 G_GNUC_INTERNAL
43 char *pcmk_dbus_get_property(
44 DBusConnection *connection, const char *target, const char *obj, const gchar * iface, const char *name,
45 void (*callback)(const char *name, const char *value, void *userdata), void *userdata,
46 DBusPendingCall **pending, int timeout);
47
48 G_GNUC_INTERNAL
49 bool pcmk_dbus_find_error(const DBusPendingCall *pending, DBusMessage *reply,
50 DBusError *error);
51
52 #ifdef __cplusplus
53 }
54 #endif
55
56 #endif