aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_bio_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_bio_lib.h')
-rw-r--r--src/include/gnunet_bio_lib.h37
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 */
91int 92enum GNUNET_GenericReturnValue
92GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); 93GNUNET_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 */
113int 114enum GNUNET_GenericReturnValue
114GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, 115GNUNET_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 */
130int 131enum GNUNET_GenericReturnValue
131GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, 132GNUNET_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 */
145int 146enum GNUNET_GenericReturnValue
146GNUNET_BIO_read_float (struct GNUNET_BIO_ReadHandle *h, 147GNUNET_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 */
158int 159enum GNUNET_GenericReturnValue
159GNUNET_BIO_read_double (struct GNUNET_BIO_ReadHandle *h, 160GNUNET_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 */
172int 173enum GNUNET_GenericReturnValue
173GNUNET_BIO_read_int32 (struct GNUNET_BIO_ReadHandle *h, 174GNUNET_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 */
186int 187enum GNUNET_GenericReturnValue
187GNUNET_BIO_read_int64 (struct GNUNET_BIO_ReadHandle *h, 188GNUNET_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 */
227int 228enum GNUNET_GenericReturnValue
228GNUNET_BIO_flush (struct GNUNET_BIO_WriteHandle *h); 229GNUNET_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 */
243int 244enum GNUNET_GenericReturnValue
244GNUNET_BIO_get_buffer_contents (struct GNUNET_BIO_WriteHandle *h, 245GNUNET_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 */
259int 260enum GNUNET_GenericReturnValue
260GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h, char **emsg); 261GNUNET_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 */
272int 273enum GNUNET_GenericReturnValue
273GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, 274GNUNET_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 */
287int 288enum GNUNET_GenericReturnValue
288GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, 289GNUNET_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 */
301int 302enum GNUNET_GenericReturnValue
302GNUNET_BIO_write_float (struct GNUNET_BIO_WriteHandle *h, 303GNUNET_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 */
313int 314enum GNUNET_GenericReturnValue
314GNUNET_BIO_write_double (struct GNUNET_BIO_WriteHandle *h, 315GNUNET_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 */
327int 328enum GNUNET_GenericReturnValue
328GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, 329GNUNET_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 */
341int 342enum GNUNET_GenericReturnValue
342GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, 343GNUNET_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 */
492int 493enum GNUNET_GenericReturnValue
493GNUNET_BIO_read_spec_commit (struct GNUNET_BIO_ReadHandle *h, 494GNUNET_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 */
638int 639enum GNUNET_GenericReturnValue
639GNUNET_BIO_write_spec_commit (struct GNUNET_BIO_WriteHandle *h, 640GNUNET_BIO_write_spec_commit (struct GNUNET_BIO_WriteHandle *h,
640 struct GNUNET_BIO_WriteSpec *ws); 641 struct GNUNET_BIO_WriteSpec *ws);
641 642