diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:09:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:09:28 +0200 |
commit | c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207 (patch) | |
tree | cac3ce030d77b4cbe7c7dc62ed58cfe6d24f73e1 /src/include/gnunet_bio_lib.h | |
parent | fbb71d527c7d6babf269a8fefce1db291b9f7068 (diff) | |
download | gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.tar.gz gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.zip |
global reindent, now with uncrustify hook enabled
Diffstat (limited to 'src/include/gnunet_bio_lib.h')
-rw-r--r-- | src/include/gnunet_bio_lib.h | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/src/include/gnunet_bio_lib.h b/src/include/gnunet_bio_lib.h index a1fd0e6ac..5529ca8f4 100644 --- a/src/include/gnunet_bio_lib.h +++ b/src/include/gnunet_bio_lib.h | |||
@@ -55,7 +55,7 @@ struct GNUNET_BIO_ReadHandle; | |||
55 | * @return IO handle on success, NULL on error | 55 | * @return IO handle on success, NULL on error |
56 | */ | 56 | */ |
57 | struct GNUNET_BIO_ReadHandle * | 57 | struct GNUNET_BIO_ReadHandle * |
58 | GNUNET_BIO_read_open(const char *fn); | 58 | GNUNET_BIO_read_open (const char *fn); |
59 | 59 | ||
60 | 60 | ||
61 | /** | 61 | /** |
@@ -67,7 +67,7 @@ GNUNET_BIO_read_open(const char *fn); | |||
67 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 67 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
68 | */ | 68 | */ |
69 | int | 69 | int |
70 | GNUNET_BIO_read_close(struct GNUNET_BIO_ReadHandle *h, char **emsg); | 70 | GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); |
71 | 71 | ||
72 | 72 | ||
73 | /** | 73 | /** |
@@ -80,8 +80,8 @@ GNUNET_BIO_read_close(struct GNUNET_BIO_ReadHandle *h, char **emsg); | |||
80 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 80 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
81 | */ | 81 | */ |
82 | int | 82 | int |
83 | GNUNET_BIO_read(struct GNUNET_BIO_ReadHandle *h, const char *what, | 83 | GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, |
84 | void *result, size_t len); | 84 | void *result, size_t len); |
85 | 85 | ||
86 | 86 | ||
87 | /** | 87 | /** |
@@ -95,9 +95,9 @@ GNUNET_BIO_read(struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
95 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 95 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
96 | */ | 96 | */ |
97 | int | 97 | int |
98 | GNUNET_BIO_read_fn(struct GNUNET_BIO_ReadHandle *h, | 98 | GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, |
99 | const char *file, int line, | 99 | const char *file, int line, |
100 | void *result, size_t len); | 100 | void *result, size_t len); |
101 | 101 | ||
102 | /** | 102 | /** |
103 | * Read 0-terminated string from a file. | 103 | * Read 0-terminated string from a file. |
@@ -110,8 +110,8 @@ GNUNET_BIO_read_fn(struct GNUNET_BIO_ReadHandle *h, | |||
110 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 110 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
111 | */ | 111 | */ |
112 | int | 112 | int |
113 | GNUNET_BIO_read_string(struct GNUNET_BIO_ReadHandle *h, const char *what, | 113 | GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, |
114 | char **result, size_t max_length); | 114 | char **result, size_t max_length); |
115 | 115 | ||
116 | 116 | ||
117 | /** | 117 | /** |
@@ -123,8 +123,8 @@ GNUNET_BIO_read_string(struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
123 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 123 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
124 | */ | 124 | */ |
125 | int | 125 | int |
126 | GNUNET_BIO_read_meta_data(struct GNUNET_BIO_ReadHandle *h, const char *what, | 126 | GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what, |
127 | struct GNUNET_CONTAINER_MetaData **result); | 127 | struct GNUNET_CONTAINER_MetaData **result); |
128 | 128 | ||
129 | 129 | ||
130 | /** | 130 | /** |
@@ -133,7 +133,8 @@ GNUNET_BIO_read_meta_data(struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
133 | * @param h hande to open file | 133 | * @param h hande to open file |
134 | * @param f address of float to read | 134 | * @param f address of float to read |
135 | */ | 135 | */ |
136 | #define GNUNET_BIO_read_float(h, f) (GNUNET_BIO_read_fn(h, __FILE__, __LINE__, f, sizeof(float))) | 136 | #define GNUNET_BIO_read_float(h, f) (GNUNET_BIO_read_fn (h, __FILE__, __LINE__, \ |
137 | f, sizeof(float))) | ||
137 | 138 | ||
138 | 139 | ||
139 | 140 | ||
@@ -143,7 +144,8 @@ GNUNET_BIO_read_meta_data(struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
143 | * @param h hande to open file | 144 | * @param h hande to open file |
144 | * @param f address of double to read | 145 | * @param f address of double to read |
145 | */ | 146 | */ |
146 | #define GNUNET_BIO_read_double(h, f) (GNUNET_BIO_read_fn(h, __FILE__, __LINE__, f, sizeof(double))) | 147 | #define GNUNET_BIO_read_double(h, f) (GNUNET_BIO_read_fn (h, __FILE__, __LINE__, \ |
148 | f, sizeof(double))) | ||
147 | 149 | ||
148 | 150 | ||
149 | /** | 151 | /** |
@@ -156,8 +158,8 @@ GNUNET_BIO_read_meta_data(struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
156 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 158 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
157 | */ | 159 | */ |
158 | int | 160 | int |
159 | GNUNET_BIO_read_int32__(struct GNUNET_BIO_ReadHandle *h, const char *file, | 161 | GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, |
160 | int line, int32_t * i); | 162 | int line, int32_t *i); |
161 | 163 | ||
162 | 164 | ||
163 | /** | 165 | /** |
@@ -166,7 +168,9 @@ GNUNET_BIO_read_int32__(struct GNUNET_BIO_ReadHandle *h, const char *file, | |||
166 | * @param h hande to open file | 168 | * @param h hande to open file |
167 | * @param i address of 32-bit integer to read | 169 | * @param i address of 32-bit integer to read |
168 | */ | 170 | */ |
169 | #define GNUNET_BIO_read_int32(h, i) GNUNET_BIO_read_int32__(h, __FILE__, __LINE__, (int32_t*)i) | 171 | #define GNUNET_BIO_read_int32(h, i) GNUNET_BIO_read_int32__ (h, __FILE__, \ |
172 | __LINE__, \ | ||
173 | (int32_t*) i) | ||
170 | 174 | ||
171 | 175 | ||
172 | /** | 176 | /** |
@@ -179,8 +183,8 @@ GNUNET_BIO_read_int32__(struct GNUNET_BIO_ReadHandle *h, const char *file, | |||
179 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 183 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
180 | */ | 184 | */ |
181 | int | 185 | int |
182 | GNUNET_BIO_read_int64__(struct GNUNET_BIO_ReadHandle *h, const char *file, | 186 | GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file, |
183 | int line, int64_t * i); | 187 | int line, int64_t *i); |
184 | 188 | ||
185 | 189 | ||
186 | /** | 190 | /** |
@@ -189,7 +193,9 @@ GNUNET_BIO_read_int64__(struct GNUNET_BIO_ReadHandle *h, const char *file, | |||
189 | * @param h hande to open file | 193 | * @param h hande to open file |
190 | * @param i address of 64-bit integer to read | 194 | * @param i address of 64-bit integer to read |
191 | */ | 195 | */ |
192 | #define GNUNET_BIO_read_int64(h, i) GNUNET_BIO_read_int64__(h, __FILE__, __LINE__, (int64_t*)i) | 196 | #define GNUNET_BIO_read_int64(h, i) GNUNET_BIO_read_int64__ (h, __FILE__, \ |
197 | __LINE__, \ | ||
198 | (int64_t*) i) | ||
193 | 199 | ||
194 | 200 | ||
195 | /** | 201 | /** |
@@ -204,7 +210,7 @@ struct GNUNET_BIO_WriteHandle; | |||
204 | * @return IO handle on success, NULL on error | 210 | * @return IO handle on success, NULL on error |
205 | */ | 211 | */ |
206 | struct GNUNET_BIO_WriteHandle * | 212 | struct GNUNET_BIO_WriteHandle * |
207 | GNUNET_BIO_write_open(const char *fn); | 213 | GNUNET_BIO_write_open (const char *fn); |
208 | 214 | ||
209 | 215 | ||
210 | /** | 216 | /** |
@@ -214,7 +220,7 @@ GNUNET_BIO_write_open(const char *fn); | |||
214 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 220 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
215 | */ | 221 | */ |
216 | int | 222 | int |
217 | GNUNET_BIO_write_close(struct GNUNET_BIO_WriteHandle *h); | 223 | GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); |
218 | 224 | ||
219 | 225 | ||
220 | /** | 226 | /** |
@@ -226,8 +232,8 @@ GNUNET_BIO_write_close(struct GNUNET_BIO_WriteHandle *h); | |||
226 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 232 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
227 | */ | 233 | */ |
228 | int | 234 | int |
229 | GNUNET_BIO_write(struct GNUNET_BIO_WriteHandle *h, const void *buffer, | 235 | GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, |
230 | size_t n); | 236 | size_t n); |
231 | 237 | ||
232 | 238 | ||
233 | /** | 239 | /** |
@@ -238,7 +244,7 @@ GNUNET_BIO_write(struct GNUNET_BIO_WriteHandle *h, const void *buffer, | |||
238 | * the file is closed | 244 | * the file is closed |
239 | */ | 245 | */ |
240 | int | 246 | int |
241 | GNUNET_BIO_flush(struct GNUNET_BIO_WriteHandle *h); | 247 | GNUNET_BIO_flush (struct GNUNET_BIO_WriteHandle *h); |
242 | 248 | ||
243 | 249 | ||
244 | /** | 250 | /** |
@@ -249,7 +255,7 @@ GNUNET_BIO_flush(struct GNUNET_BIO_WriteHandle *h); | |||
249 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 255 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
250 | */ | 256 | */ |
251 | int | 257 | int |
252 | GNUNET_BIO_write_string(struct GNUNET_BIO_WriteHandle *h, const char *s); | 258 | GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); |
253 | 259 | ||
254 | 260 | ||
255 | /** | 261 | /** |
@@ -260,8 +266,8 @@ GNUNET_BIO_write_string(struct GNUNET_BIO_WriteHandle *h, const char *s); | |||
260 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 266 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
261 | */ | 267 | */ |
262 | int | 268 | int |
263 | GNUNET_BIO_write_meta_data(struct GNUNET_BIO_WriteHandle *h, | 269 | GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, |
264 | const struct GNUNET_CONTAINER_MetaData *m); | 270 | const struct GNUNET_CONTAINER_MetaData *m); |
265 | 271 | ||
266 | 272 | ||
267 | 273 | ||
@@ -271,7 +277,7 @@ GNUNET_BIO_write_meta_data(struct GNUNET_BIO_WriteHandle *h, | |||
271 | * @param h hande to open file | 277 | * @param h hande to open file |
272 | * @param f float to write (must be a variable) | 278 | * @param f float to write (must be a variable) |
273 | */ | 279 | */ |
274 | #define GNUNET_BIO_write_float(h, f) GNUNET_BIO_write(h, &f, sizeof(float)) | 280 | #define GNUNET_BIO_write_float(h, f) GNUNET_BIO_write (h, &f, sizeof(float)) |
275 | 281 | ||
276 | 282 | ||
277 | 283 | ||
@@ -281,7 +287,7 @@ GNUNET_BIO_write_meta_data(struct GNUNET_BIO_WriteHandle *h, | |||
281 | * @param h hande to open file | 287 | * @param h hande to open file |
282 | * @param f double to write (must be a variable) | 288 | * @param f double to write (must be a variable) |
283 | */ | 289 | */ |
284 | #define GNUNET_BIO_write_double(h, f) GNUNET_BIO_write(h, &f, sizeof(double)) | 290 | #define GNUNET_BIO_write_double(h, f) GNUNET_BIO_write (h, &f, sizeof(double)) |
285 | 291 | ||
286 | 292 | ||
287 | /** | 293 | /** |
@@ -292,7 +298,7 @@ GNUNET_BIO_write_meta_data(struct GNUNET_BIO_WriteHandle *h, | |||
292 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 298 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
293 | */ | 299 | */ |
294 | int | 300 | int |
295 | GNUNET_BIO_write_int32(struct GNUNET_BIO_WriteHandle *h, int32_t i); | 301 | GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); |
296 | 302 | ||
297 | 303 | ||
298 | /** | 304 | /** |
@@ -303,7 +309,7 @@ GNUNET_BIO_write_int32(struct GNUNET_BIO_WriteHandle *h, int32_t i); | |||
303 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 309 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
304 | */ | 310 | */ |
305 | int | 311 | int |
306 | GNUNET_BIO_write_int64(struct GNUNET_BIO_WriteHandle *h, int64_t i); | 312 | GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i); |
307 | 313 | ||
308 | 314 | ||
309 | #if 0 /* keep Emacsens' auto-indent happy */ | 315 | #if 0 /* keep Emacsens' auto-indent happy */ |