aboutsummaryrefslogtreecommitdiff
path: root/src/lib/include/gnunet_dbus_lib_object_path.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/include/gnunet_dbus_lib_object_path.h')
-rw-r--r--src/lib/include/gnunet_dbus_lib_object_path.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/lib/include/gnunet_dbus_lib_object_path.h b/src/lib/include/gnunet_dbus_lib_object_path.h
new file mode 100644
index 0000000..ec93d99
--- /dev/null
+++ b/src/lib/include/gnunet_dbus_lib_object_path.h
@@ -0,0 +1,62 @@
1#ifndef GNUNET_DBUS_LIB_OBJECT_PATH_H
2#define GNUNET_DBUS_LIB_OBJECT_PATH_H
3
4#include "gnunet_dbus_lib_object.h"
5
6/**
7 * Represents a path of DBus objects in service's object namespace. eg.
8 * /org/freedesktop/PolicyKit1/Authority
9 */
10struct GNUNET_DBUS_ObjectPath;
11
12/**
13 * Create an object path from a GNUNET_DBUS_Service and a list of
14 * GNUNET_DBUS_Object. The last item in the list must be NULL.
15 * For example, to create the path to the
16 * /org/freedesktop/PolicyKit1/Authority1 object you would call as:
17 *
18 * GNUNET_DBUS_object_path_create(policy_kit_service_object,
19 * org_object,
20 * freedesktop_object,
21 * PolicyKit1_object,
22 * Authority_object,
23 * NULL);
24 */
25struct GNUNET_DBUS_ObjectPath *
26GNUNET_DBUS_object_path_create (
27 struct GNUNET_DBUS_Service *service,
28 ...)
29 __attribute__((sentinel));
30
31/**
32 * Increase the reference count of this GNUNET_DBUS_ObjectPath by one.
33 */
34void
35GNUNET_DBUS_object_path_ref (
36 struct GNUNET_DBUS_ObjectPath *path);
37
38/**
39 * Decrease the reference count of this GNUNET_DBUS_ObjectPath by one. Will
40 * free the GNUNET_DBUS_ObjectPath if the reference count reaches zero.
41 */
42void
43GNUNET_DBUS_object_path_unref (
44 struct GNUNET_DBUS_ObjectPath *path);
45
46/**
47 * Format the GNUNET_DBUS_ObjectPath as a string. eg.
48 * "/org/freedesktop/PolicyKit1/Authority1".
49 */
50char *
51GNUNET_DBUS_object_path_to_string (
52 const struct GNUNET_DBUS_ObjectPath *path);
53
54/**
55 * Get the destination object of this path. ie. the final object in the path.
56 */
57struct GNUNET_DBUS_Object *
58GNUNET_DBUS_object_path_get_destination (
59 const struct GNUNET_DBUS_ObjectPath *path);
60
61#endif
62