diff options
Diffstat (limited to 'src/lib/include/gnunet_dbus_lib_signature.h')
-rw-r--r-- | src/lib/include/gnunet_dbus_lib_signature.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/lib/include/gnunet_dbus_lib_signature.h b/src/lib/include/gnunet_dbus_lib_signature.h new file mode 100644 index 0000000..b5ebc84 --- /dev/null +++ b/src/lib/include/gnunet_dbus_lib_signature.h | |||
@@ -0,0 +1,42 @@ | |||
1 | #ifndef GNUNET_DBUS_LIB_SIGNATURE_H | ||
2 | #define GNUNET_DBUS_LIB_SIGNATURE_H | ||
3 | |||
4 | #include <dbus/dbus.h> | ||
5 | #include "gnunet_crypto_dbus_lib.h" | ||
6 | |||
7 | #define GNUNET_DBUS_SIGNATURE_BYTE DBUS_TYPE_BYTE_AS_STRING | ||
8 | #define GNUNET_DBUS_SIGNATURE_BOOLEAN DBUS_TYPE_BOOLEAN_AS_STRING | ||
9 | #define GNUNET_DBUS_SIGNATURE_INT16 DBUS_TYPE_INT16_AS_STRING | ||
10 | #define GNUNET_DBUS_SIGNATURE_UINT16 DBUS_TYPE_UINT16_AS_STRING | ||
11 | #define GNUNET_DBUS_SIGNATURE_INT32 DBUS_TYPE_INT32_AS_STRING | ||
12 | #define GNUNET_DBUS_SIGNATURE_UINT32 DBUS_TYPE_UINT32_AS_STRING | ||
13 | #define GNUNET_DBUS_SIGNATURE_INT64 DBUS_TYPE_INT64_AS_STRING | ||
14 | #define GNUNET_DBUS_SIGNATURE_UINT64 DBUS_TYPE_UINT64_AS_STRING | ||
15 | #define GNUNET_DBUS_SIGNATURE_DOUBLE DBUS_TYPE_DOUBLE_AS_STRING | ||
16 | #define GNUNET_DBUS_SIGNATURE_STRING DBUS_TYPE_STRING_AS_STRING | ||
17 | #define GNUNET_DBUS_SIGNATURE_OBJECT_PATH DBUS_TYPE_OBJECT_PATH_AS_STRING | ||
18 | #define GNUNET_DBUS_SIGNATURE_SIGNATURE DBUS_TYPE_SIGNATURE_AS_STRING | ||
19 | #define GNUNET_DBUS_SIGNATURE_UNIX_FD DBUS_TYPE_UNIX_FD_AS_STRING | ||
20 | #define GNUNET_DBUS_SIGNATURE_VARIANT DBUS_TYPE_VARIANT_AS_STRING | ||
21 | |||
22 | #define GNUNET_DBUS_SIGNATURE_ARRAY(s) DBUS_TYPE_ARRAY_AS_STRING s | ||
23 | #define GNUNET_DBUS_SIGNATURE_DICT(s) DBUS_TYPE_ARRAY_AS_STRING DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING s DBUS_DICT_ENTRY_END_CHAR_AS_STRING | ||
24 | #define GNUNET_DBUS_SIGNATURE_STRUCT(s) DBUS_STRUCT_BEGIN_CHAR_AS_STRING s DBUS_STRUCT_END_CHAR_AS_STRING | ||
25 | |||
26 | #define GNUNET_DBUS_SIGNATURE_BITFIELD GNUNET_DBUS_SIGNATURE_VARIANT | ||
27 | #define GNUNET_DBUS_SIGNATURE_ENUM GNUNET_DBUS_SIGNATURE_VARIANT | ||
28 | |||
29 | #define GNUNET_DBUS_SIGNATURE_HASHCODE GNUNET_DBUS_SIGNATURE_VARIANT | ||
30 | #define GNUNET_DBUS_SIGNATURE_PEER_IDENTITY GNUNET_DBUS_SIGNATURE_STRUCT(GNUNET_CRYPTO_DBUS_SIGNATURE_EDDSA_PUBLIC_KEY) | ||
31 | |||
32 | /** | ||
33 | * Formats the given DBus typecode as a string. For example, | ||
34 | * GNUNET_DBUS_signature_typecode_to_string(DBUS_TYPE_UINT32) will return the | ||
35 | * constant string "u" | ||
36 | */ | ||
37 | const char * | ||
38 | GNUNET_DBUS_signature_typecode_to_string ( | ||
39 | int typecode); | ||
40 | |||
41 | #endif | ||
42 | |||