diff options
Diffstat (limited to 'src/lib/include/gnunet_dbus_lib_arg.h')
-rw-r--r-- | src/lib/include/gnunet_dbus_lib_arg.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/lib/include/gnunet_dbus_lib_arg.h b/src/lib/include/gnunet_dbus_lib_arg.h new file mode 100644 index 0000000..34a8a68 --- /dev/null +++ b/src/lib/include/gnunet_dbus_lib_arg.h | |||
@@ -0,0 +1,75 @@ | |||
1 | #ifndef GNUNET_DBUS_LIB_ARG_H | ||
2 | #define GNUNET_DBUS_LIB_ARG_H | ||
3 | |||
4 | /** | ||
5 | * Used to represent an argument to a DBus method or signal. An argument | ||
6 | * consists of a name and a DBus type signature. | ||
7 | */ | ||
8 | struct GNUNET_DBUS_Arg; | ||
9 | |||
10 | /** | ||
11 | * An iterable, doubly-linked-list of GNUNET_DBUS_Arg. | ||
12 | */ | ||
13 | struct GNUNET_DBUS_ArgIterator | ||
14 | { | ||
15 | /* linked list */ | ||
16 | struct GNUNET_DBUS_ArgIterator *next; | ||
17 | struct GNUNET_DBUS_ArgIterator *prev; | ||
18 | |||
19 | struct GNUNET_DBUS_Arg *arg; | ||
20 | }; | ||
21 | |||
22 | /** | ||
23 | * Create a GNUNET_DBUS_Arg with the given name, DBus type signature and a | ||
24 | * reference count of one. | ||
25 | */ | ||
26 | struct GNUNET_DBUS_Arg * | ||
27 | GNUNET_DBUS_arg_create ( | ||
28 | const char *name, | ||
29 | const char *signature); | ||
30 | |||
31 | /** | ||
32 | * Increase the reference count of this GNUNET_DBUS_Arg by one. | ||
33 | */ | ||
34 | void | ||
35 | GNUNET_DBUS_arg_ref ( | ||
36 | struct GNUNET_DBUS_Arg *arg); | ||
37 | |||
38 | /** | ||
39 | * Decrease the reference count of this GNUNET_DBUS_Arg by one. Will free the | ||
40 | * GNNET_DBUS_Arg if the reference count reaches zero. | ||
41 | */ | ||
42 | void | ||
43 | GNUNET_DBUS_arg_unref ( | ||
44 | struct GNUNET_DBUS_Arg *arg); | ||
45 | |||
46 | /** | ||
47 | * Get the name of this GNUNET_DBUS_Arg. | ||
48 | */ | ||
49 | const char * | ||
50 | GNUNET_DBUS_arg_get_name ( | ||
51 | const struct GNUNET_DBUS_Arg *arg); | ||
52 | |||
53 | /** | ||
54 | * Get the DBus type signature of this GNUNET_DBUS_Arg. | ||
55 | */ | ||
56 | const char * | ||
57 | GNUNET_DBUS_arg_get_signature ( | ||
58 | const struct GNUNET_DBUS_Arg *arg); | ||
59 | |||
60 | #if 0 | ||
61 | void | ||
62 | GNUNET_DBUS_arg_pop_message ( | ||
63 | const struct GNUNET_DBUS_Arg *arg, | ||
64 | DBusMessageIter *dbus_message_iter, | ||
65 | void *value); | ||
66 | |||
67 | void | ||
68 | GNUNET_DBUS_arg_push_message ( | ||
69 | const struct GNUNET_DBUS_Arg *arg, | ||
70 | DBusMessageIter *dbus_message_iter, | ||
71 | va_list vl); | ||
72 | #endif | ||
73 | |||
74 | #endif | ||
75 | |||