aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_reclaim_attribute_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_reclaim_attribute_lib.h')
-rw-r--r--src/include/gnunet_reclaim_attribute_lib.h55
1 files changed, 26 insertions, 29 deletions
diff --git a/src/include/gnunet_reclaim_attribute_lib.h b/src/include/gnunet_reclaim_attribute_lib.h
index e96937ea8..527a3977e 100644
--- a/src/include/gnunet_reclaim_attribute_lib.h
+++ b/src/include/gnunet_reclaim_attribute_lib.h
@@ -16,7 +16,7 @@
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
18 SPDX-License-Identifier: AGPL3.0-or-later 18 SPDX-License-Identifier: AGPL3.0-or-later
19*/ 19 */
20 20
21/** 21/**
22 * @author Martin Schanzenbach 22 * @author Martin Schanzenbach
@@ -54,8 +54,7 @@ extern "C" {
54/** 54/**
55 * An attribute. 55 * An attribute.
56 */ 56 */
57struct GNUNET_RECLAIM_ATTRIBUTE_Claim 57struct GNUNET_RECLAIM_ATTRIBUTE_Claim {
58{
59 /** 58 /**
60 * ID 59 * ID
61 */ 60 */
@@ -93,8 +92,7 @@ struct GNUNET_RECLAIM_ATTRIBUTE_Claim
93/** 92/**
94 * A list of GNUNET_RECLAIM_ATTRIBUTE_Claim structures. 93 * A list of GNUNET_RECLAIM_ATTRIBUTE_Claim structures.
95 */ 94 */
96struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList 95struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList {
97{
98 /** 96 /**
99 * List head 97 * List head
100 */ 98 */
@@ -107,8 +105,7 @@ struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList
107}; 105};
108 106
109 107
110struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry 108struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry {
111{
112 /** 109 /**
113 * DLL 110 * DLL
114 */ 111 */
@@ -136,10 +133,10 @@ struct GNUNET_RECLAIM_ATTRIBUTE_ClaimListEntry
136 * @return the new attribute 133 * @return the new attribute
137 */ 134 */
138struct GNUNET_RECLAIM_ATTRIBUTE_Claim * 135struct GNUNET_RECLAIM_ATTRIBUTE_Claim *
139GNUNET_RECLAIM_ATTRIBUTE_claim_new (const char *attr_name, 136GNUNET_RECLAIM_ATTRIBUTE_claim_new(const char *attr_name,
140 uint32_t type, 137 uint32_t type,
141 const void *data, 138 const void *data,
142 size_t data_size); 139 size_t data_size);
143 140
144 141
145/** 142/**
@@ -149,7 +146,7 @@ GNUNET_RECLAIM_ATTRIBUTE_claim_new (const char *attr_name,
149 * @return the required buffer size 146 * @return the required buffer size
150 */ 147 */
151size_t 148size_t
152GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size ( 149GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size(
153 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs); 150 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
154 151
155 152
@@ -159,7 +156,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_serialize_get_size (
159 * @param attrs list to destroy 156 * @param attrs list to destroy
160 */ 157 */
161void 158void
162GNUNET_RECLAIM_ATTRIBUTE_list_destroy ( 159GNUNET_RECLAIM_ATTRIBUTE_list_destroy(
163 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs); 160 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
164 161
165 162
@@ -172,7 +169,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_destroy (
172 * @param data_size claim payload size 169 * @param data_size claim payload size
173 */ 170 */
174void 171void
175GNUNET_RECLAIM_ATTRIBUTE_list_add ( 172GNUNET_RECLAIM_ATTRIBUTE_list_add(
176 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, 173 struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
177 const char *attr_name, 174 const char *attr_name,
178 uint32_t type, 175 uint32_t type,
@@ -188,7 +185,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_add (
188 * @return length of serialized data 185 * @return length of serialized data
189 */ 186 */
190size_t 187size_t
191GNUNET_RECLAIM_ATTRIBUTE_list_serialize ( 188GNUNET_RECLAIM_ATTRIBUTE_list_serialize(
192 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs, 189 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
193 char *result); 190 char *result);
194 191
@@ -201,7 +198,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_serialize (
201 * @return a GNUNET_IDENTITY_PROVIDER_AttributeList, must be free'd by caller 198 * @return a GNUNET_IDENTITY_PROVIDER_AttributeList, must be free'd by caller
202 */ 199 */
203struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList * 200struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *
204GNUNET_RECLAIM_ATTRIBUTE_list_deserialize (const char *data, size_t data_size); 201GNUNET_RECLAIM_ATTRIBUTE_list_deserialize(const char *data, size_t data_size);
205 202
206 203
207/** 204/**
@@ -211,7 +208,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_deserialize (const char *data, size_t data_size);
211 * @return the required buffer size 208 * @return the required buffer size
212 */ 209 */
213size_t 210size_t
214GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size ( 211GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size(
215 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr); 212 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr);
216 213
217 214
@@ -223,7 +220,7 @@ GNUNET_RECLAIM_ATTRIBUTE_serialize_get_size (
223 * @return length of serialized data 220 * @return length of serialized data
224 */ 221 */
225size_t 222size_t
226GNUNET_RECLAIM_ATTRIBUTE_serialize ( 223GNUNET_RECLAIM_ATTRIBUTE_serialize(
227 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr, 224 const struct GNUNET_RECLAIM_ATTRIBUTE_Claim *attr,
228 char *result); 225 char *result);
229 226
@@ -237,7 +234,7 @@ GNUNET_RECLAIM_ATTRIBUTE_serialize (
237 * @return a GNUNET_IDENTITY_PROVIDER_Attribute, must be free'd by caller 234 * @return a GNUNET_IDENTITY_PROVIDER_Attribute, must be free'd by caller
238 */ 235 */
239struct GNUNET_RECLAIM_ATTRIBUTE_Claim * 236struct GNUNET_RECLAIM_ATTRIBUTE_Claim *
240GNUNET_RECLAIM_ATTRIBUTE_deserialize (const char *data, size_t data_size); 237GNUNET_RECLAIM_ATTRIBUTE_deserialize(const char *data, size_t data_size);
241 238
242 239
243/** 240/**
@@ -246,7 +243,7 @@ GNUNET_RECLAIM_ATTRIBUTE_deserialize (const char *data, size_t data_size);
246 * @return copied claim list 243 * @return copied claim list
247 */ 244 */
248struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList * 245struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *
249GNUNET_RECLAIM_ATTRIBUTE_list_dup ( 246GNUNET_RECLAIM_ATTRIBUTE_list_dup(
250 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs); 247 const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs);
251 248
252 249
@@ -257,7 +254,7 @@ GNUNET_RECLAIM_ATTRIBUTE_list_dup (
257 * @return corresponding number, UINT32_MAX on error 254 * @return corresponding number, UINT32_MAX on error
258 */ 255 */
259uint32_t 256uint32_t
260GNUNET_RECLAIM_ATTRIBUTE_typename_to_number (const char *typename); 257GNUNET_RECLAIM_ATTRIBUTE_typename_to_number(const char *typename);
261 258
262/** 259/**
263 * Convert human-readable version of a 'claim' of an attribute to the binary 260 * Convert human-readable version of a 'claim' of an attribute to the binary
@@ -270,10 +267,10 @@ GNUNET_RECLAIM_ATTRIBUTE_typename_to_number (const char *typename);
270 * @return #GNUNET_OK on success 267 * @return #GNUNET_OK on success
271 */ 268 */
272int 269int
273GNUNET_RECLAIM_ATTRIBUTE_string_to_value (uint32_t type, 270GNUNET_RECLAIM_ATTRIBUTE_string_to_value(uint32_t type,
274 const char *s, 271 const char *s,
275 void **data, 272 void **data,
276 size_t *data_size); 273 size_t *data_size);
277 274
278 275
279/** 276/**
@@ -285,9 +282,9 @@ GNUNET_RECLAIM_ATTRIBUTE_string_to_value (uint32_t type,
285 * @return NULL on error, otherwise human-readable representation of the claim 282 * @return NULL on error, otherwise human-readable representation of the claim
286 */ 283 */
287char * 284char *
288GNUNET_RECLAIM_ATTRIBUTE_value_to_string (uint32_t type, 285GNUNET_RECLAIM_ATTRIBUTE_value_to_string(uint32_t type,
289 const void *data, 286 const void *data,
290 size_t data_size); 287 size_t data_size);
291 288
292 289
293/** 290/**
@@ -297,7 +294,7 @@ GNUNET_RECLAIM_ATTRIBUTE_value_to_string (uint32_t type,
297 * @return corresponding typestring, NULL on error 294 * @return corresponding typestring, NULL on error
298 */ 295 */
299const char * 296const char *
300GNUNET_RECLAIM_ATTRIBUTE_number_to_typename (uint32_t type); 297GNUNET_RECLAIM_ATTRIBUTE_number_to_typename(uint32_t type);
301 298
302 299
303#if 0 /* keep Emacsens' auto-indent happy */ 300#if 0 /* keep Emacsens' auto-indent happy */