aboutsummaryrefslogtreecommitdiff
path: root/src/lib/include/gnunet_dbus_lib_arg.h
blob: 34a8a6832e419c3b249316666b307ca8f529ec8c (plain) (blame)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef GNUNET_DBUS_LIB_ARG_H
#define GNUNET_DBUS_LIB_ARG_H

/**
 * Used to represent an argument to a DBus method or signal. An argument
 * consists of a name and a DBus type signature.
 */
struct GNUNET_DBUS_Arg;

/**
 * An iterable, doubly-linked-list of GNUNET_DBUS_Arg.
 */
struct GNUNET_DBUS_ArgIterator
{
  /* linked list */
  struct GNUNET_DBUS_ArgIterator *next;
  struct GNUNET_DBUS_ArgIterator *prev;

  struct GNUNET_DBUS_Arg *arg;
};

/**
 * Create a GNUNET_DBUS_Arg with the given name, DBus type signature and a
 * reference count of one.
 */
struct GNUNET_DBUS_Arg *
GNUNET_DBUS_arg_create (
    const char *name,
    const char *signature);

/**
 * Increase the reference count of this GNUNET_DBUS_Arg by one.
 */
void
GNUNET_DBUS_arg_ref (
    struct GNUNET_DBUS_Arg *arg);

/**
 * Decrease the reference count of this GNUNET_DBUS_Arg by one. Will free the
 * GNNET_DBUS_Arg if the reference count reaches zero.
 */
void
GNUNET_DBUS_arg_unref (
    struct GNUNET_DBUS_Arg *arg);

/**
 * Get the name of this GNUNET_DBUS_Arg.
 */
const char *
GNUNET_DBUS_arg_get_name (
    const struct GNUNET_DBUS_Arg *arg);

/**
 * Get the DBus type signature of this GNUNET_DBUS_Arg.
 */
const char *
GNUNET_DBUS_arg_get_signature (
    const struct GNUNET_DBUS_Arg *arg);

#if 0
void
GNUNET_DBUS_arg_pop_message (
    const struct GNUNET_DBUS_Arg *arg,
    DBusMessageIter *dbus_message_iter,
    void *value);

void
GNUNET_DBUS_arg_push_message (
    const struct GNUNET_DBUS_Arg *arg,
    DBusMessageIter *dbus_message_iter,
    va_list vl);
#endif

#endif