diff options
Diffstat (limited to 'src/include/gnunet_bio_lib.h')
-rw-r--r-- | src/include/gnunet_bio_lib.h | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/include/gnunet_bio_lib.h b/src/include/gnunet_bio_lib.h index 48a1a512d..73550db7e 100644 --- a/src/include/gnunet_bio_lib.h +++ b/src/include/gnunet_bio_lib.h | |||
@@ -33,6 +33,7 @@ | |||
33 | * @{ | 33 | * @{ |
34 | */ | 34 | */ |
35 | 35 | ||
36 | #include "gnunet_common.h" | ||
36 | #if !defined (__GNUNET_UTIL_LIB_H_INSIDE__) | 37 | #if !defined (__GNUNET_UTIL_LIB_H_INSIDE__) |
37 | #error "Only <gnunet_util_lib.h> can be included directly." | 38 | #error "Only <gnunet_util_lib.h> can be included directly." |
38 | #endif | 39 | #endif |
@@ -88,7 +89,7 @@ GNUNET_BIO_read_open_buffer (void *buffer, size_t size); | |||
88 | * @param emsg set to the error message | 89 | * @param emsg set to the error message |
89 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 90 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
90 | */ | 91 | */ |
91 | int | 92 | enum GNUNET_GenericReturnValue |
92 | GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); | 93 | GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); |
93 | 94 | ||
94 | /** | 95 | /** |
@@ -110,7 +111,7 @@ GNUNET_BIO_read_set_error (struct GNUNET_BIO_ReadHandle *h, const char* emsg); | |||
110 | * @param len the number of bytes to read | 111 | * @param len the number of bytes to read |
111 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 112 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
112 | */ | 113 | */ |
113 | int | 114 | enum GNUNET_GenericReturnValue |
114 | GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, | 115 | GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, |
115 | const char *what, | 116 | const char *what, |
116 | void *result, | 117 | void *result, |
@@ -127,7 +128,7 @@ GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, | |||
127 | * @param max_length maximum allowed length for the string | 128 | * @param max_length maximum allowed length for the string |
128 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 129 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
129 | */ | 130 | */ |
130 | int | 131 | enum GNUNET_GenericReturnValue |
131 | GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, | 132 | GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, |
132 | const char *what, | 133 | const char *what, |
133 | char **result, | 134 | char **result, |
@@ -142,7 +143,7 @@ GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, | |||
142 | * @param what describes what is being read (for error message creation) | 143 | * @param what describes what is being read (for error message creation) |
143 | * @param f address of float to read | 144 | * @param f address of float to read |
144 | */ | 145 | */ |
145 | int | 146 | enum GNUNET_GenericReturnValue |
146 | GNUNET_BIO_read_float (struct GNUNET_BIO_ReadHandle *h, | 147 | GNUNET_BIO_read_float (struct GNUNET_BIO_ReadHandle *h, |
147 | const char *what, | 148 | const char *what, |
148 | float *f); | 149 | float *f); |
@@ -155,7 +156,7 @@ GNUNET_BIO_read_float (struct GNUNET_BIO_ReadHandle *h, | |||
155 | * @param what describes what is being read (for error message creation) | 156 | * @param what describes what is being read (for error message creation) |
156 | * @param f address of double to read | 157 | * @param f address of double to read |
157 | */ | 158 | */ |
158 | int | 159 | enum GNUNET_GenericReturnValue |
159 | GNUNET_BIO_read_double (struct GNUNET_BIO_ReadHandle *h, | 160 | GNUNET_BIO_read_double (struct GNUNET_BIO_ReadHandle *h, |
160 | const char *what, | 161 | const char *what, |
161 | double *f); | 162 | double *f); |
@@ -169,7 +170,7 @@ GNUNET_BIO_read_double (struct GNUNET_BIO_ReadHandle *h, | |||
169 | * @param i where to store the data | 170 | * @param i where to store the data |
170 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 171 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
171 | */ | 172 | */ |
172 | int | 173 | enum GNUNET_GenericReturnValue |
173 | GNUNET_BIO_read_int32 (struct GNUNET_BIO_ReadHandle *h, | 174 | GNUNET_BIO_read_int32 (struct GNUNET_BIO_ReadHandle *h, |
174 | const char *what, | 175 | const char *what, |
175 | int32_t *i); | 176 | int32_t *i); |
@@ -183,7 +184,7 @@ GNUNET_BIO_read_int32 (struct GNUNET_BIO_ReadHandle *h, | |||
183 | * @param i where to store the data | 184 | * @param i where to store the data |
184 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 185 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
185 | */ | 186 | */ |
186 | int | 187 | enum GNUNET_GenericReturnValue |
187 | GNUNET_BIO_read_int64 (struct GNUNET_BIO_ReadHandle *h, | 188 | GNUNET_BIO_read_int64 (struct GNUNET_BIO_ReadHandle *h, |
188 | const char *what, | 189 | const char *what, |
189 | int64_t *i); | 190 | int64_t *i); |
@@ -224,7 +225,7 @@ GNUNET_BIO_write_open_buffer (void); | |||
224 | * @return #GNUNET_OK upon success. Upon failure #GNUNET_SYSERR is returned | 225 | * @return #GNUNET_OK upon success. Upon failure #GNUNET_SYSERR is returned |
225 | * and the file is closed | 226 | * and the file is closed |
226 | */ | 227 | */ |
227 | int | 228 | enum GNUNET_GenericReturnValue |
228 | GNUNET_BIO_flush (struct GNUNET_BIO_WriteHandle *h); | 229 | GNUNET_BIO_flush (struct GNUNET_BIO_WriteHandle *h); |
229 | 230 | ||
230 | 231 | ||
@@ -240,7 +241,7 @@ GNUNET_BIO_flush (struct GNUNET_BIO_WriteHandle *h); | |||
240 | * @param size where to store the size of @e contents | 241 | * @param size where to store the size of @e contents |
241 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 242 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
242 | */ | 243 | */ |
243 | int | 244 | enum GNUNET_GenericReturnValue |
244 | GNUNET_BIO_get_buffer_contents (struct GNUNET_BIO_WriteHandle *h, | 245 | GNUNET_BIO_get_buffer_contents (struct GNUNET_BIO_WriteHandle *h, |
245 | char **emsg, | 246 | char **emsg, |
246 | void **contents, | 247 | void **contents, |
@@ -256,7 +257,7 @@ GNUNET_BIO_get_buffer_contents (struct GNUNET_BIO_WriteHandle *h, | |||
256 | * if the handle has an error message, the return value is #GNUNET_SYSERR | 257 | * if the handle has an error message, the return value is #GNUNET_SYSERR |
257 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 258 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
258 | */ | 259 | */ |
259 | int | 260 | enum GNUNET_GenericReturnValue |
260 | GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h, char **emsg); | 261 | GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h, char **emsg); |
261 | 262 | ||
262 | 263 | ||
@@ -269,7 +270,7 @@ GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h, char **emsg); | |||
269 | * @param n number of bytes to write | 270 | * @param n number of bytes to write |
270 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 271 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
271 | */ | 272 | */ |
272 | int | 273 | enum GNUNET_GenericReturnValue |
273 | GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, | 274 | GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, |
274 | const char *what, | 275 | const char *what, |
275 | const void *buffer, | 276 | const void *buffer, |
@@ -284,7 +285,7 @@ GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, | |||
284 | * @param s string to write (can be NULL) | 285 | * @param s string to write (can be NULL) |
285 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 286 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
286 | */ | 287 | */ |
287 | int | 288 | enum GNUNET_GenericReturnValue |
288 | GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, | 289 | GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, |
289 | const char *what, | 290 | const char *what, |
290 | const char *s); | 291 | const char *s); |
@@ -298,7 +299,7 @@ GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, | |||
298 | * @param what what is being written (for error message creation) | 299 | * @param what what is being written (for error message creation) |
299 | * @param f float to write (must be a variable) | 300 | * @param f float to write (must be a variable) |
300 | */ | 301 | */ |
301 | int | 302 | enum GNUNET_GenericReturnValue |
302 | GNUNET_BIO_write_float (struct GNUNET_BIO_WriteHandle *h, | 303 | GNUNET_BIO_write_float (struct GNUNET_BIO_WriteHandle *h, |
303 | const char *what, | 304 | const char *what, |
304 | float f); | 305 | float f); |
@@ -310,7 +311,7 @@ GNUNET_BIO_write_float (struct GNUNET_BIO_WriteHandle *h, | |||
310 | * @param what what is being written (for error message creation) | 311 | * @param what what is being written (for error message creation) |
311 | * @param f double to write (must be a variable) | 312 | * @param f double to write (must be a variable) |
312 | */ | 313 | */ |
313 | int | 314 | enum GNUNET_GenericReturnValue |
314 | GNUNET_BIO_write_double (struct GNUNET_BIO_WriteHandle *h, | 315 | GNUNET_BIO_write_double (struct GNUNET_BIO_WriteHandle *h, |
315 | const char *what, | 316 | const char *what, |
316 | double f); | 317 | double f); |
@@ -324,7 +325,7 @@ GNUNET_BIO_write_double (struct GNUNET_BIO_WriteHandle *h, | |||
324 | * @param i 32-bit integer to write | 325 | * @param i 32-bit integer to write |
325 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 326 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
326 | */ | 327 | */ |
327 | int | 328 | enum GNUNET_GenericReturnValue |
328 | GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, | 329 | GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, |
329 | const char *what, | 330 | const char *what, |
330 | int32_t i); | 331 | int32_t i); |
@@ -338,7 +339,7 @@ GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, | |||
338 | * @param i 64-bit integer to write | 339 | * @param i 64-bit integer to write |
339 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 340 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
340 | */ | 341 | */ |
341 | int | 342 | enum GNUNET_GenericReturnValue |
342 | GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, | 343 | GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, |
343 | const char *what, | 344 | const char *what, |
344 | int64_t i); | 345 | int64_t i); |
@@ -489,7 +490,7 @@ GNUNET_BIO_read_spec_double (const char *what, double *f); | |||
489 | * the last element must be #GNUNET_BIO_read_spec_end | 490 | * the last element must be #GNUNET_BIO_read_spec_end |
490 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 491 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
491 | */ | 492 | */ |
492 | int | 493 | enum GNUNET_GenericReturnValue |
493 | GNUNET_BIO_read_spec_commit (struct GNUNET_BIO_ReadHandle *h, | 494 | GNUNET_BIO_read_spec_commit (struct GNUNET_BIO_ReadHandle *h, |
494 | struct GNUNET_BIO_ReadSpec *rs); | 495 | struct GNUNET_BIO_ReadSpec *rs); |
495 | 496 | ||
@@ -635,7 +636,7 @@ GNUNET_BIO_write_spec_double (const char *what, double *f); | |||
635 | * the last element must be #GNUNET_BIO_write_spec_end | 636 | * the last element must be #GNUNET_BIO_write_spec_end |
636 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 637 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
637 | */ | 638 | */ |
638 | int | 639 | enum GNUNET_GenericReturnValue |
639 | GNUNET_BIO_write_spec_commit (struct GNUNET_BIO_WriteHandle *h, | 640 | GNUNET_BIO_write_spec_commit (struct GNUNET_BIO_WriteHandle *h, |
640 | struct GNUNET_BIO_WriteSpec *ws); | 641 | struct GNUNET_BIO_WriteSpec *ws); |
641 | 642 | ||