aboutsummaryrefslogtreecommitdiff
path: root/src/lib/include/gnunet_dbus_lib_signal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/include/gnunet_dbus_lib_signal.h')
-rw-r--r--src/lib/include/gnunet_dbus_lib_signal.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/src/lib/include/gnunet_dbus_lib_signal.h b/src/lib/include/gnunet_dbus_lib_signal.h
new file mode 100644
index 0000000..af314fe
--- /dev/null
+++ b/src/lib/include/gnunet_dbus_lib_signal.h
@@ -0,0 +1,102 @@
1#ifndef GNUNET_DBUS_LIB_SIGNAL_H
2#define GNUNET_DBUS_LIB_SIGNAL_H
3
4/**
5 * Defines a DBus signal that may be sent from an interface.
6 */
7struct GNUNET_DBUS_Signal;
8
9#include "gnunet_dbus_lib_object_path.h"
10#include "gnunet_dbus_lib_interface.h"
11
12/**
13 * An iterable, double-linked-list of GNUNET_DBUS_Signal.
14 */
15struct GNUNET_DBUS_SignalIterator
16{
17 /* linked list */
18 struct GNUNET_DBUS_SignalIterator *next;
19 struct GNUNET_DBUS_SignalIterator *prev;
20
21 struct GNUNET_DBUS_Signal *signal;
22};
23
24/**
25 * Create a signal with the given name. The signal should be populated with
26 * argument definitions then bound to an interface with
27 * GNUNET_DBUS_interface_add_signal.
28 */
29struct GNUNET_DBUS_Signal *
30GNUNET_DBUS_signal_create (
31 const char *name);
32
33/**
34 * Increase the reference count of this GNUNET_DBUS_Signal by one.
35 */
36void
37GNUNET_DBUS_signal_ref (
38 struct GNUNET_DBUS_Signal *signal);
39
40/**
41 * Decrease the reference count of this GNUNET_DBUS_Signal by one. Will free
42 * the GNUNET_DBUS_Signal if the reference count reaches zero.
43 */
44void
45GNUNET_DBUS_signal_unref (
46 struct GNUNET_DBUS_Signal *signal);
47
48/**
49 * Adds an argument definition to this GNUNET_DBUS_Signal given both it's name
50 * and it's DBus type signature.
51 */
52void
53GNUNET_DBUS_signal_add_arg (
54 struct GNUNET_DBUS_Signal *signal,
55 const char *name,
56 const char *signature);
57
58/**
59 * Get the name of this GNUNET_DBUS_Signal.
60 */
61const char *
62GNUNET_DBUS_signal_get_name (
63 const struct GNUNET_DBUS_Signal *signal);
64
65/**
66 * Iterate over the arguments of this GNUNET_DBUS_Signal.
67 */
68const struct GNUNET_DBUS_ArgIterator *
69GNUNET_DBUS_signal_iterate_args (
70 const struct GNUNET_DBUS_Signal *signal);
71
72/**
73 * Instantiate the signal so that it can be sent to all interested peers on the
74 * bus. The returned DBusMessage must be populated with the signal's arguments
75 * and can then be sent to send the signal. The signal will originate from the
76 * supplied object path and interface. pretty sets whether data pushed to the
77 * returned DBusMessage will be prety-encoded.
78 */
79DBusMessage *
80GNUNET_DBUS_signal_spawn (
81 const struct GNUNET_DBUS_Signal *signal,
82 const struct GNUNET_DBUS_ObjectPath *path,
83 const struct GNUNET_DBUS_Interface *interface,
84 bool pretty);
85
86/**
87 * Instantiate the signal so that it can be sent to a single client. The
88 * returned DBusMessage must be populated with the signal's arguments and can
89 * then be sent to send the signal. The signal will originate from the supplied
90 * object path and interface. pretty sets whether data pushed to the returned
91 * DBusMessage will be prety-encoded.
92 */
93DBusMessage *
94GNUNET_DBUS_signal_spawn_unicast (
95 const struct GNUNET_DBUS_Signal *signal,
96 const struct GNUNET_DBUS_ObjectPath *path,
97 const struct GNUNET_DBUS_Interface *interface,
98 const struct GNUNET_DBUS_Client *client,
99 bool pretty);
100
101#endif
102