diff options
Diffstat (limited to 'src/include/gnunet_bio_lib.h')
-rw-r--r-- | src/include/gnunet_bio_lib.h | 62 |
1 files changed, 38 insertions, 24 deletions
diff --git a/src/include/gnunet_bio_lib.h b/src/include/gnunet_bio_lib.h index 74512ec40..de356d1e5 100644 --- a/src/include/gnunet_bio_lib.h +++ b/src/include/gnunet_bio_lib.h | |||
@@ -49,7 +49,8 @@ struct GNUNET_BIO_ReadHandle; | |||
49 | * @param fn file name to be opened | 49 | * @param fn file name to be opened |
50 | * @return IO handle on success, NULL on error | 50 | * @return IO handle on success, NULL on error |
51 | */ | 51 | */ |
52 | struct GNUNET_BIO_ReadHandle *GNUNET_BIO_read_open (const char *fn); | 52 | struct GNUNET_BIO_ReadHandle * |
53 | GNUNET_BIO_read_open (const char *fn); | ||
53 | 54 | ||
54 | 55 | ||
55 | /** | 56 | /** |
@@ -60,7 +61,8 @@ struct GNUNET_BIO_ReadHandle *GNUNET_BIO_read_open (const char *fn); | |||
60 | * @param emsg set to the error message | 61 | * @param emsg set to the error message |
61 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 62 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
62 | */ | 63 | */ |
63 | int GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); | 64 | int |
65 | GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); | ||
64 | 66 | ||
65 | 67 | ||
66 | /** | 68 | /** |
@@ -72,8 +74,9 @@ int GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); | |||
72 | * @param len the number of bytes to read | 74 | * @param len the number of bytes to read |
73 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 75 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
74 | */ | 76 | */ |
75 | int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, | 77 | int |
76 | void *result, size_t len); | 78 | GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, |
79 | void *result, size_t len); | ||
77 | 80 | ||
78 | 81 | ||
79 | /** | 82 | /** |
@@ -86,8 +89,9 @@ int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
86 | * @param len the number of bytes to read | 89 | * @param len the number of bytes to read |
87 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 90 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
88 | */ | 91 | */ |
89 | int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, | 92 | int |
90 | int line, void *result, size_t len); | 93 | GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, int line, |
94 | void *result, size_t len); | ||
91 | 95 | ||
92 | /** | 96 | /** |
93 | * Read 0-terminated string from a file. | 97 | * Read 0-terminated string from a file. |
@@ -99,8 +103,9 @@ int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, | |||
99 | * @param maxLen maximum allowed length for the string | 103 | * @param maxLen maximum allowed length for the string |
100 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 104 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
101 | */ | 105 | */ |
102 | int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, | 106 | int |
103 | char **result, size_t maxLen); | 107 | GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, |
108 | char **result, size_t maxLen); | ||
104 | 109 | ||
105 | 110 | ||
106 | /** | 111 | /** |
@@ -111,9 +116,9 @@ int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
111 | * @param result the buffer to store a pointer to the (allocated) metadata | 116 | * @param result the buffer to store a pointer to the (allocated) metadata |
112 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 117 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
113 | */ | 118 | */ |
114 | int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, | 119 | int |
115 | const char *what, | 120 | GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what, |
116 | struct GNUNET_CONTAINER_MetaData **result); | 121 | struct GNUNET_CONTAINER_MetaData **result); |
117 | 122 | ||
118 | 123 | ||
119 | /** | 124 | /** |
@@ -144,8 +149,9 @@ int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, | |||
144 | * @param i address of 32-bit integer to read | 149 | * @param i address of 32-bit integer to read |
145 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 150 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
146 | */ | 151 | */ |
147 | int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, | 152 | int |
148 | int line, int32_t * i); | 153 | GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, |
154 | int line, int32_t * i); | ||
149 | 155 | ||
150 | 156 | ||
151 | /** | 157 | /** |
@@ -166,8 +172,9 @@ int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, | |||
166 | * @param i address of 64-bit integer to read | 172 | * @param i address of 64-bit integer to read |
167 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 173 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
168 | */ | 174 | */ |
169 | int GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file, | 175 | int |
170 | int line, int64_t * i); | 176 | GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file, |
177 | int line, int64_t * i); | ||
171 | 178 | ||
172 | 179 | ||
173 | /** | 180 | /** |
@@ -190,7 +197,8 @@ struct GNUNET_BIO_WriteHandle; | |||
190 | * @param fn file name to be opened | 197 | * @param fn file name to be opened |
191 | * @return IO handle on success, NULL on error | 198 | * @return IO handle on success, NULL on error |
192 | */ | 199 | */ |
193 | struct GNUNET_BIO_WriteHandle *GNUNET_BIO_write_open (const char *fn); | 200 | struct GNUNET_BIO_WriteHandle * |
201 | GNUNET_BIO_write_open (const char *fn); | ||
194 | 202 | ||
195 | 203 | ||
196 | /** | 204 | /** |
@@ -199,7 +207,8 @@ struct GNUNET_BIO_WriteHandle *GNUNET_BIO_write_open (const char *fn); | |||
199 | * @param h file handle | 207 | * @param h file handle |
200 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 208 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
201 | */ | 209 | */ |
202 | int GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); | 210 | int |
211 | GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); | ||
203 | 212 | ||
204 | 213 | ||
205 | /** | 214 | /** |
@@ -210,8 +219,9 @@ int GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); | |||
210 | * @param n number of bytes to write | 219 | * @param n number of bytes to write |
211 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 220 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
212 | */ | 221 | */ |
213 | int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, | 222 | int |
214 | size_t n); | 223 | GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, |
224 | size_t n); | ||
215 | 225 | ||
216 | 226 | ||
217 | /** | 227 | /** |
@@ -221,7 +231,8 @@ int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, | |||
221 | * @param s string to write (can be NULL) | 231 | * @param s string to write (can be NULL) |
222 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 232 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
223 | */ | 233 | */ |
224 | int GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); | 234 | int |
235 | GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); | ||
225 | 236 | ||
226 | 237 | ||
227 | 238 | ||
@@ -233,8 +244,9 @@ int GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); | |||
233 | * @param m metadata to write | 244 | * @param m metadata to write |
234 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 245 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
235 | */ | 246 | */ |
236 | int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, | 247 | int |
237 | const struct GNUNET_CONTAINER_MetaData *m); | 248 | GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, |
249 | const struct GNUNET_CONTAINER_MetaData *m); | ||
238 | 250 | ||
239 | 251 | ||
240 | 252 | ||
@@ -264,7 +276,8 @@ int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, | |||
264 | * @param i address of 32-bit integer to write | 276 | * @param i address of 32-bit integer to write |
265 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 277 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
266 | */ | 278 | */ |
267 | int GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); | 279 | int |
280 | GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); | ||
268 | 281 | ||
269 | 282 | ||
270 | /** | 283 | /** |
@@ -274,7 +287,8 @@ int GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); | |||
274 | * @param i address of 64-bit integer to write | 287 | * @param i address of 64-bit integer to write |
275 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 288 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
276 | */ | 289 | */ |
277 | int GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i); | 290 | int |
291 | GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i); | ||
278 | 292 | ||
279 | 293 | ||
280 | #if 0 /* keep Emacsens' auto-indent happy */ | 294 | #if 0 /* keep Emacsens' auto-indent happy */ |