This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathdbusrecv.h
60 lines (46 loc) · 1.52 KB
/
dbusrecv.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* @file
*
* @brief Headers for dbusrecv plugin
*
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
*
*/
#ifndef ELEKTRA_PLUGIN_DBUS_H
#define ELEKTRA_PLUGIN_DBUS_H
#include <kdbassert.h>
#include <kdbioplugin.h>
#include <kdbnotificationinternal.h>
#include <kdbplugin.h>
#include <dbus/dbus.h>
#include <string.h>
// elektraIoDbus*()
#include <kdbio/adapters/dbus.h>
/**
* @internal
* Private plugin data
*/
typedef struct
{
// I/O binding (may be NULL)
ElektraIoInterface * ioBinding;
// Notification callback (may be NULL)
ElektraNotificationCallback notificationCallback;
void * notificationContext;
// Indicates whether D-Bus connections are initialized
int dbusInitialized;
// D-Bus connections (may be NULL)
DBusConnection * systemBus;
DBusConnection * sessionBus;
// D-Bus I/O adapter handles
ElektraIoAdapterDbusHandle * systemBusAdapter;
ElektraIoAdapterDbusHandle * sessionBusAdapter;
} ElektraDbusRecvPluginData;
int elektraDbusRecvSetupReceive (Plugin * handle, DBusBusType type, DBusHandleMessageFunction filter_func);
int elektraDbusRecvTeardownReceive (Plugin * handle, DBusBusType type, DBusHandleMessageFunction filter_func);
DBusHandlerResult elektraDbusRecvMessageHandler (DBusConnection * connection, DBusMessage * message, void * data);
int elektraDbusRecvOpen (Plugin * handle, Key * errorKey);
int elektraDbusRecvClose (Plugin * handle, Key * errorKey);
int elektraDbusRecvGet (Plugin * handle, KeySet * ks, Key * parentKey);
Plugin * ELEKTRA_PLUGIN_EXPORT;
#endif