forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzeromqrecv.h
More file actions
58 lines (43 loc) · 1.35 KB
/
zeromqrecv.h
File metadata and controls
58 lines (43 loc) · 1.35 KB
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
/**
* @file
*
* @brief Headers for dbusrecv plugin
*
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
*
*/
#ifndef ELEKTRA_PLUGIN_ZEROMQSEND_H
#define ELEKTRA_PLUGIN_ZEROMQSEND_H
#include <kdbassert.h>
#include <kdbioplugin.h>
#include <kdbnotificationinternal.h>
#include <kdbplugin.h>
#include <zmq.h>
#include <kdbio/adapters/zeromq.h> // elektraIoAdapterZeroMq*()
#define ELEKTRA_ZEROMQ_DEFAULT_SUB_ENDPOINT "tcp://localhost:6001"
/**
* @internal
* Private plugin state
*/
typedef struct
{
// I/O binding (may be NULL)
ElektraIoInterface * ioBinding;
// Notification callback (may be NULL)
ElektraNotificationCallback notificationCallback;
void * notificationContext;
// ZeroMQ context and socket (NULL until initialized at first elektraZeroMqRecvPublish())
void * zmqContext;
void * zmqSubscriber;
// endpoint for subscribe socket
const char * endpoint;
// ZeroMQ I/O adapter handle (NULL without I/O binding)
ElektraIoAdapterZeroMqHandle * zmqAdapter;
} ElektraZeroMqRecvPluginData;
void elektraZeroMqRecvSetup (Plugin * handle);
void elektraZeroMqRecvTeardown (Plugin * handle);
int elektraZeroMqRecvOpen (Plugin * handle, Key * errorKey);
int elektraZeroMqRecvClose (Plugin * handle, Key * errorKey);
int elektraZeroMqRecvGet (Plugin * handle, KeySet * ks, Key * parentKey);
Plugin * ELEKTRA_PLUGIN_EXPORT;
#endif