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