Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / network / WirelessManager / wpa_supplicant / dbus / dbus_dict_helpers.h
blobeb315753174ff8e49fd6014ca062f50e17de0f5e
1 /*
2 * WPA Supplicant / dbus-based control interface
3 * Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
12 * See README and COPYING for more details.
15 #ifndef DBUS_DICT_HELPERS_H
16 #define DBUS_DICT_HELPERS_H
19 * Adding a dict to a DBusMessage
22 dbus_bool_t wpa_dbus_dict_open_write(DBusMessageIter *iter,
23 DBusMessageIter *iter_dict);
25 dbus_bool_t wpa_dbus_dict_close_write(DBusMessageIter *iter,
26 DBusMessageIter *iter_dict);
28 const char * wpa_dbus_type_as_string(const int type);
30 dbus_bool_t wpa_dbus_dict_append_string(DBusMessageIter *iter_dict,
31 const char *key, const char *value);
33 dbus_bool_t wpa_dbus_dict_append_byte(DBusMessageIter *iter_dict,
34 const char *key, const char value);
36 dbus_bool_t wpa_dbus_dict_append_bool(DBusMessageIter *iter_dict,
37 const char *key,
38 const dbus_bool_t value);
40 dbus_bool_t wpa_dbus_dict_append_int16(DBusMessageIter *iter_dict,
41 const char *key,
42 const dbus_int16_t value);
44 dbus_bool_t wpa_dbus_dict_append_uint16(DBusMessageIter *iter_dict,
45 const char *key,
46 const dbus_uint16_t value);
48 dbus_bool_t wpa_dbus_dict_append_int32(DBusMessageIter *iter_dict,
49 const char *key,
50 const dbus_int32_t value);
52 dbus_bool_t wpa_dbus_dict_append_uint32(DBusMessageIter *iter_dict,
53 const char *key,
54 const dbus_uint32_t value);
56 dbus_bool_t wpa_dbus_dict_append_int64(DBusMessageIter *iter_dict,
57 const char *key,
58 const dbus_int64_t value);
60 dbus_bool_t wpa_dbus_dict_append_uint64(DBusMessageIter *iter_dict,
61 const char *key,
62 const dbus_uint64_t value);
64 dbus_bool_t wpa_dbus_dict_append_double(DBusMessageIter *iter_dict,
65 const char *key,
66 const double value);
68 dbus_bool_t wpa_dbus_dict_append_object_path(DBusMessageIter *iter_dict,
69 const char *key,
70 const char *value);
72 dbus_bool_t wpa_dbus_dict_append_byte_array(DBusMessageIter *iter_dict,
73 const char *key,
74 const char *value,
75 const dbus_uint32_t value_len);
77 /* Manual construction and addition of string array elements */
78 dbus_bool_t wpa_dbus_dict_begin_string_array(DBusMessageIter *iter_dict,
79 const char *key,
80 DBusMessageIter *iter_dict_entry,
81 DBusMessageIter *iter_dict_val,
82 DBusMessageIter *iter_array);
84 dbus_bool_t wpa_dbus_dict_string_array_add_element(DBusMessageIter *iter_array,
85 const char *elem);
87 dbus_bool_t wpa_dbus_dict_end_string_array(DBusMessageIter *iter_dict,
88 DBusMessageIter *iter_dict_entry,
89 DBusMessageIter *iter_dict_val,
90 DBusMessageIter *iter_array);
92 /* Convenience function to add a whole string list */
93 dbus_bool_t wpa_dbus_dict_append_string_array(DBusMessageIter *iter_dict,
94 const char *key,
95 const char **items,
96 const dbus_uint32_t num_items);
99 * Reading a dict from a DBusMessage
102 struct wpa_dbus_dict_entry {
103 int type; /** the dbus type of the dict entry's value */
104 int array_type; /** the dbus type of the array elements if the dict
105 entry value contains an array */
106 const char *key; /** key of the dict entry */
108 /** Possible values of the property */
109 union {
110 char *str_value;
111 char byte_value;
112 dbus_bool_t bool_value;
113 dbus_int16_t int16_value;
114 dbus_uint16_t uint16_value;
115 dbus_int32_t int32_value;
116 dbus_uint32_t uint32_value;
117 dbus_int64_t int64_value;
118 dbus_uint64_t uint64_value;
119 double double_value;
120 char *bytearray_value;
121 char **strarray_value;
123 dbus_uint32_t array_len; /** length of the array if the dict entry's
124 value contains an array */
127 dbus_bool_t wpa_dbus_dict_open_read(DBusMessageIter *iter,
128 DBusMessageIter *iter_dict);
130 dbus_bool_t wpa_dbus_dict_get_entry(DBusMessageIter *iter_dict,
131 struct wpa_dbus_dict_entry *entry);
133 dbus_bool_t wpa_dbus_dict_has_dict_entry(DBusMessageIter *iter_dict);
135 void wpa_dbus_dict_entry_clear(struct wpa_dbus_dict_entry *entry);
137 #endif /* DBUS_DICT_HELPERS_H */