diff options
author | ng0 <ng0@n0.is> | 2019-09-08 12:33:09 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-09-08 12:33:09 +0000 |
commit | d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb (patch) | |
tree | 9efd18ea7d425652085ed0bd5e8e45604bc5f6b9 /src/include/gnunet_disk_lib.h | |
parent | a0fce305c565c0937d917a92712f15e9c5736260 (diff) | |
download | gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.tar.gz gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.zip |
uncrustify as demanded.
Diffstat (limited to 'src/include/gnunet_disk_lib.h')
-rw-r--r-- | src/include/gnunet_disk_lib.h | 199 |
1 files changed, 94 insertions, 105 deletions
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index 367789722..f693615f1 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
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 | * @author Christian Grothoff | 21 | * @author Christian Grothoff |
22 | * | 22 | * |
@@ -38,8 +38,7 @@ struct GNUNET_DISK_PipeHandle; | |||
38 | /** | 38 | /** |
39 | * Type of a handle. | 39 | * Type of a handle. |
40 | */ | 40 | */ |
41 | enum GNUNET_FILE_Type | 41 | enum GNUNET_FILE_Type { |
42 | { | ||
43 | /** | 42 | /** |
44 | * Handle represents an event. | 43 | * Handle represents an event. |
45 | */ | 44 | */ |
@@ -59,9 +58,7 @@ enum GNUNET_FILE_Type | |||
59 | /** | 58 | /** |
60 | * Handle used to access files (and pipes). | 59 | * Handle used to access files (and pipes). |
61 | */ | 60 | */ |
62 | struct GNUNET_DISK_FileHandle | 61 | struct GNUNET_DISK_FileHandle { |
63 | { | ||
64 | |||
65 | #if WINDOWS | 62 | #if WINDOWS |
66 | /** | 63 | /** |
67 | * File handle under W32. | 64 | * File handle under W32. |
@@ -83,12 +80,10 @@ struct GNUNET_DISK_FileHandle | |||
83 | */ | 80 | */ |
84 | OVERLAPPED *oOverlapWrite; | 81 | OVERLAPPED *oOverlapWrite; |
85 | #else | 82 | #else |
86 | |||
87 | /** | 83 | /** |
88 | * File handle on other OSes. | 84 | * File handle on other OSes. |
89 | */ | 85 | */ |
90 | int fd; | 86 | int fd; |
91 | |||
92 | #endif | 87 | #endif |
93 | }; | 88 | }; |
94 | 89 | ||
@@ -113,9 +108,7 @@ extern "C" | |||
113 | /** | 108 | /** |
114 | * Specifies how a file should be opened. | 109 | * Specifies how a file should be opened. |
115 | */ | 110 | */ |
116 | enum GNUNET_DISK_OpenFlags | 111 | enum GNUNET_DISK_OpenFlags { |
117 | { | ||
118 | |||
119 | /** | 112 | /** |
120 | * Open the file for reading | 113 | * Open the file for reading |
121 | */ | 114 | */ |
@@ -155,8 +148,7 @@ enum GNUNET_DISK_OpenFlags | |||
155 | /** | 148 | /** |
156 | * Specifies what type of memory map is desired. | 149 | * Specifies what type of memory map is desired. |
157 | */ | 150 | */ |
158 | enum GNUNET_DISK_MapType | 151 | enum GNUNET_DISK_MapType { |
159 | { | ||
160 | /** | 152 | /** |
161 | * Read-only memory map. | 153 | * Read-only memory map. |
162 | */ | 154 | */ |
@@ -177,8 +169,7 @@ enum GNUNET_DISK_MapType | |||
177 | /** | 169 | /** |
178 | * File access permissions, UNIX-style. | 170 | * File access permissions, UNIX-style. |
179 | */ | 171 | */ |
180 | enum GNUNET_DISK_AccessPermissions | 172 | enum GNUNET_DISK_AccessPermissions { |
181 | { | ||
182 | /** | 173 | /** |
183 | * Nobody is allowed to do anything to the file. | 174 | * Nobody is allowed to do anything to the file. |
184 | */ | 175 | */ |
@@ -235,8 +226,7 @@ enum GNUNET_DISK_AccessPermissions | |||
235 | * Constants for specifying how to seek. Do not change values or order, | 226 | * Constants for specifying how to seek. Do not change values or order, |
236 | * some of the code depends on the specific numeric values! | 227 | * some of the code depends on the specific numeric values! |
237 | */ | 228 | */ |
238 | enum GNUNET_DISK_Seek | 229 | enum GNUNET_DISK_Seek { |
239 | { | ||
240 | /** | 230 | /** |
241 | * Seek an absolute position (from the start of the file). | 231 | * Seek an absolute position (from the start of the file). |
242 | */ | 232 | */ |
@@ -257,8 +247,7 @@ enum GNUNET_DISK_Seek | |||
257 | /** | 247 | /** |
258 | * Enumeration identifying the two ends of a pipe. | 248 | * Enumeration identifying the two ends of a pipe. |
259 | */ | 249 | */ |
260 | enum GNUNET_DISK_PipeEnd | 250 | enum GNUNET_DISK_PipeEnd { |
261 | { | ||
262 | /** | 251 | /** |
263 | * The reading-end of a pipe. | 252 | * The reading-end of a pipe. |
264 | */ | 253 | */ |
@@ -278,7 +267,7 @@ enum GNUNET_DISK_PipeEnd | |||
278 | * @return #GNUNET_YES if invalid, #GNUNET_NO if valid | 267 | * @return #GNUNET_YES if invalid, #GNUNET_NO if valid |
279 | */ | 268 | */ |
280 | int | 269 | int |
281 | GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); | 270 | GNUNET_DISK_handle_invalid(const struct GNUNET_DISK_FileHandle *h); |
282 | 271 | ||
283 | 272 | ||
284 | /** | 273 | /** |
@@ -290,7 +279,7 @@ GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); | |||
290 | * else (will print an error message in that case, too). | 279 | * else (will print an error message in that case, too). |
291 | */ | 280 | */ |
292 | int | 281 | int |
293 | GNUNET_DISK_file_test (const char *fil); | 282 | GNUNET_DISK_file_test(const char *fil); |
294 | 283 | ||
295 | 284 | ||
296 | /** | 285 | /** |
@@ -301,7 +290,7 @@ GNUNET_DISK_file_test (const char *fil); | |||
301 | * @param fil name of the file to back up | 290 | * @param fil name of the file to back up |
302 | */ | 291 | */ |
303 | void | 292 | void |
304 | GNUNET_DISK_file_backup (const char *fil); | 293 | GNUNET_DISK_file_backup(const char *fil); |
305 | 294 | ||
306 | 295 | ||
307 | /** | 296 | /** |
@@ -312,8 +301,8 @@ GNUNET_DISK_file_backup (const char *fil); | |||
312 | * @return the new position on success, GNUNET_SYSERR otherwise | 301 | * @return the new position on success, GNUNET_SYSERR otherwise |
313 | */ | 302 | */ |
314 | off_t | 303 | off_t |
315 | GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, off_t offset, | 304 | GNUNET_DISK_file_seek(const struct GNUNET_DISK_FileHandle *h, off_t offset, |
316 | enum GNUNET_DISK_Seek whence); | 305 | enum GNUNET_DISK_Seek whence); |
317 | 306 | ||
318 | 307 | ||
319 | /** | 308 | /** |
@@ -331,10 +320,10 @@ GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, off_t offset, | |||
331 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 320 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
332 | */ | 321 | */ |
333 | int | 322 | int |
334 | GNUNET_DISK_file_size (const char *filename, | 323 | GNUNET_DISK_file_size(const char *filename, |
335 | uint64_t *size, | 324 | uint64_t *size, |
336 | int include_symbolic_links, | 325 | int include_symbolic_links, |
337 | int single_file_mode); | 326 | int single_file_mode); |
338 | 327 | ||
339 | 328 | ||
340 | /** | 329 | /** |
@@ -353,9 +342,9 @@ GNUNET_DISK_file_size (const char *filename, | |||
353 | * @return #GNUNET_OK on success | 342 | * @return #GNUNET_OK on success |
354 | */ | 343 | */ |
355 | int | 344 | int |
356 | GNUNET_DISK_file_get_identifiers (const char *filename, | 345 | GNUNET_DISK_file_get_identifiers(const char *filename, |
357 | uint64_t *dev, | 346 | uint64_t *dev, |
358 | uint64_t *ino); | 347 | uint64_t *ino); |
359 | 348 | ||
360 | 349 | ||
361 | /** | 350 | /** |
@@ -370,7 +359,7 @@ GNUNET_DISK_file_get_identifiers (const char *filename, | |||
370 | * file on disk in directory for temporary files | 359 | * file on disk in directory for temporary files |
371 | */ | 360 | */ |
372 | char * | 361 | char * |
373 | GNUNET_DISK_mktemp (const char *t); | 362 | GNUNET_DISK_mktemp(const char *t); |
374 | 363 | ||
375 | 364 | ||
376 | /** | 365 | /** |
@@ -383,7 +372,7 @@ GNUNET_DISK_mktemp (const char *t); | |||
383 | * @return NULL on error, otherwise name of freshly created directory | 372 | * @return NULL on error, otherwise name of freshly created directory |
384 | */ | 373 | */ |
385 | char * | 374 | char * |
386 | GNUNET_DISK_mkdtemp (const char *t); | 375 | GNUNET_DISK_mkdtemp(const char *t); |
387 | 376 | ||
388 | 377 | ||
389 | /** | 378 | /** |
@@ -399,9 +388,9 @@ GNUNET_DISK_mkdtemp (const char *t); | |||
399 | * @return IO handle on success, NULL on error | 388 | * @return IO handle on success, NULL on error |
400 | */ | 389 | */ |
401 | struct GNUNET_DISK_FileHandle * | 390 | struct GNUNET_DISK_FileHandle * |
402 | GNUNET_DISK_file_open (const char *fn, | 391 | GNUNET_DISK_file_open(const char *fn, |
403 | enum GNUNET_DISK_OpenFlags flags, | 392 | enum GNUNET_DISK_OpenFlags flags, |
404 | enum GNUNET_DISK_AccessPermissions perm); | 393 | enum GNUNET_DISK_AccessPermissions perm); |
405 | 394 | ||
406 | 395 | ||
407 | /** | 396 | /** |
@@ -412,8 +401,8 @@ GNUNET_DISK_file_open (const char *fn, | |||
412 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 401 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
413 | */ | 402 | */ |
414 | int | 403 | int |
415 | GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh, | 404 | GNUNET_DISK_file_handle_size(struct GNUNET_DISK_FileHandle *fh, |
416 | off_t *size); | 405 | off_t *size); |
417 | 406 | ||
418 | 407 | ||
419 | /** | 408 | /** |
@@ -426,10 +415,10 @@ GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh, | |||
426 | * @return handle to the new pipe, NULL on error | 415 | * @return handle to the new pipe, NULL on error |
427 | */ | 416 | */ |
428 | struct GNUNET_DISK_PipeHandle * | 417 | struct GNUNET_DISK_PipeHandle * |
429 | GNUNET_DISK_pipe (int blocking_read, | 418 | GNUNET_DISK_pipe(int blocking_read, |
430 | int blocking_write, | 419 | int blocking_write, |
431 | int inherit_read, | 420 | int inherit_read, |
432 | int inherit_write); | 421 | int inherit_write); |
433 | 422 | ||
434 | 423 | ||
435 | /** | 424 | /** |
@@ -443,9 +432,9 @@ GNUNET_DISK_pipe (int blocking_read, | |||
443 | * @return handle to the new pipe, NULL on error | 432 | * @return handle to the new pipe, NULL on error |
444 | */ | 433 | */ |
445 | struct GNUNET_DISK_PipeHandle * | 434 | struct GNUNET_DISK_PipeHandle * |
446 | GNUNET_DISK_pipe_from_fd (int blocking_read, | 435 | GNUNET_DISK_pipe_from_fd(int blocking_read, |
447 | int blocking_write, | 436 | int blocking_write, |
448 | int fd[2]); | 437 | int fd[2]); |
449 | 438 | ||
450 | 439 | ||
451 | /** | 440 | /** |
@@ -454,7 +443,7 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, | |||
454 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 443 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
455 | */ | 444 | */ |
456 | int | 445 | int |
457 | GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); | 446 | GNUNET_DISK_pipe_close(struct GNUNET_DISK_PipeHandle *p); |
458 | 447 | ||
459 | 448 | ||
460 | /** | 449 | /** |
@@ -465,8 +454,8 @@ GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); | |||
465 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 454 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
466 | */ | 455 | */ |
467 | int | 456 | int |
468 | GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, | 457 | GNUNET_DISK_pipe_close_end(struct GNUNET_DISK_PipeHandle *p, |
469 | enum GNUNET_DISK_PipeEnd end); | 458 | enum GNUNET_DISK_PipeEnd end); |
470 | 459 | ||
471 | 460 | ||
472 | /** | 461 | /** |
@@ -482,8 +471,8 @@ GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, | |||
482 | * (or if that end is not present or is closed). | 471 | * (or if that end is not present or is closed). |
483 | */ | 472 | */ |
484 | struct GNUNET_DISK_FileHandle * | 473 | struct GNUNET_DISK_FileHandle * |
485 | GNUNET_DISK_pipe_detach_end (struct GNUNET_DISK_PipeHandle *p, | 474 | GNUNET_DISK_pipe_detach_end(struct GNUNET_DISK_PipeHandle *p, |
486 | enum GNUNET_DISK_PipeEnd end); | 475 | enum GNUNET_DISK_PipeEnd end); |
487 | 476 | ||
488 | /** | 477 | /** |
489 | * Close an open file. | 478 | * Close an open file. |
@@ -492,7 +481,7 @@ GNUNET_DISK_pipe_detach_end (struct GNUNET_DISK_PipeHandle *p, | |||
492 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 481 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
493 | */ | 482 | */ |
494 | int | 483 | int |
495 | GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); | 484 | GNUNET_DISK_file_close(struct GNUNET_DISK_FileHandle *h); |
496 | 485 | ||
497 | 486 | ||
498 | /** | 487 | /** |
@@ -503,8 +492,8 @@ GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); | |||
503 | * @return handle for the respective end | 492 | * @return handle for the respective end |
504 | */ | 493 | */ |
505 | const struct GNUNET_DISK_FileHandle * | 494 | const struct GNUNET_DISK_FileHandle * |
506 | GNUNET_DISK_pipe_handle (const struct GNUNET_DISK_PipeHandle *p, | 495 | GNUNET_DISK_pipe_handle(const struct GNUNET_DISK_PipeHandle *p, |
507 | enum GNUNET_DISK_PipeEnd n); | 496 | enum GNUNET_DISK_PipeEnd n); |
508 | 497 | ||
509 | 498 | ||
510 | #if WINDOWS | 499 | #if WINDOWS |
@@ -516,7 +505,7 @@ GNUNET_DISK_pipe_handle (const struct GNUNET_DISK_PipeHandle *p, | |||
516 | * @return GNUnet file handle corresponding to the W32 handle | 505 | * @return GNUnet file handle corresponding to the W32 handle |
517 | */ | 506 | */ |
518 | struct GNUNET_DISK_FileHandle * | 507 | struct GNUNET_DISK_FileHandle * |
519 | GNUNET_DISK_get_handle_from_w32_handle (HANDLE osfh); | 508 | GNUNET_DISK_get_handle_from_w32_handle(HANDLE osfh); |
520 | #endif | 509 | #endif |
521 | 510 | ||
522 | /** | 511 | /** |
@@ -529,9 +518,9 @@ GNUNET_DISK_get_handle_from_w32_handle (HANDLE osfh); | |||
529 | * @param require_gid_match #GNUNET_YES means 770 unless @a require_uid_match is set | 518 | * @param require_gid_match #GNUNET_YES means 770 unless @a require_uid_match is set |
530 | */ | 519 | */ |
531 | void | 520 | void |
532 | GNUNET_DISK_fix_permissions (const char *fn, | 521 | GNUNET_DISK_fix_permissions(const char *fn, |
533 | int require_uid_match, | 522 | int require_uid_match, |
534 | int require_gid_match); | 523 | int require_gid_match); |
535 | 524 | ||
536 | 525 | ||
537 | /** | 526 | /** |
@@ -541,7 +530,7 @@ GNUNET_DISK_fix_permissions (const char *fn, | |||
541 | * @return file handle corresponding to the descriptor | 530 | * @return file handle corresponding to the descriptor |
542 | */ | 531 | */ |
543 | struct GNUNET_DISK_FileHandle * | 532 | struct GNUNET_DISK_FileHandle * |
544 | GNUNET_DISK_get_handle_from_int_fd (int fno); | 533 | GNUNET_DISK_get_handle_from_int_fd(int fno); |
545 | 534 | ||
546 | 535 | ||
547 | /** | 536 | /** |
@@ -551,7 +540,7 @@ GNUNET_DISK_get_handle_from_int_fd (int fno); | |||
551 | * @return file handle corresponding to the descriptor | 540 | * @return file handle corresponding to the descriptor |
552 | */ | 541 | */ |
553 | struct GNUNET_DISK_FileHandle * | 542 | struct GNUNET_DISK_FileHandle * |
554 | GNUNET_DISK_get_handle_from_native (FILE *fd); | 543 | GNUNET_DISK_get_handle_from_native(FILE *fd); |
555 | 544 | ||
556 | 545 | ||
557 | /** | 546 | /** |
@@ -563,9 +552,9 @@ GNUNET_DISK_get_handle_from_native (FILE *fd); | |||
563 | * @return the number of bytes read on success, #GNUNET_SYSERR on failure | 552 | * @return the number of bytes read on success, #GNUNET_SYSERR on failure |
564 | */ | 553 | */ |
565 | ssize_t | 554 | ssize_t |
566 | GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, | 555 | GNUNET_DISK_file_read(const struct GNUNET_DISK_FileHandle *h, |
567 | void *result, | 556 | void *result, |
568 | size_t len); | 557 | size_t len); |
569 | 558 | ||
570 | 559 | ||
571 | /** | 560 | /** |
@@ -579,9 +568,9 @@ GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, | |||
579 | * @return the number of bytes read on success, #GNUNET_SYSERR on failure | 568 | * @return the number of bytes read on success, #GNUNET_SYSERR on failure |
580 | */ | 569 | */ |
581 | ssize_t | 570 | ssize_t |
582 | GNUNET_DISK_file_read_non_blocking (const struct GNUNET_DISK_FileHandle * h, | 571 | GNUNET_DISK_file_read_non_blocking(const struct GNUNET_DISK_FileHandle * h, |
583 | void *result, | 572 | void *result, |
584 | size_t len); | 573 | size_t len); |
585 | 574 | ||
586 | 575 | ||
587 | /** | 576 | /** |
@@ -593,9 +582,9 @@ GNUNET_DISK_file_read_non_blocking (const struct GNUNET_DISK_FileHandle * h, | |||
593 | * @return number of bytes read, #GNUNET_SYSERR on failure | 582 | * @return number of bytes read, #GNUNET_SYSERR on failure |
594 | */ | 583 | */ |
595 | ssize_t | 584 | ssize_t |
596 | GNUNET_DISK_fn_read (const char *fn, | 585 | GNUNET_DISK_fn_read(const char *fn, |
597 | void *result, | 586 | void *result, |
598 | size_t len); | 587 | size_t len); |
599 | 588 | ||
600 | 589 | ||
601 | /** | 590 | /** |
@@ -607,9 +596,9 @@ GNUNET_DISK_fn_read (const char *fn, | |||
607 | * @return number of bytes written on success, #GNUNET_SYSERR on error | 596 | * @return number of bytes written on success, #GNUNET_SYSERR on error |
608 | */ | 597 | */ |
609 | ssize_t | 598 | ssize_t |
610 | GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, | 599 | GNUNET_DISK_file_write(const struct GNUNET_DISK_FileHandle *h, |
611 | const void *buffer, | 600 | const void *buffer, |
612 | size_t n); | 601 | size_t n); |
613 | 602 | ||
614 | 603 | ||
615 | /** | 604 | /** |
@@ -621,9 +610,9 @@ GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, | |||
621 | * @return number of bytes written on success, #GNUNET_SYSERR on error | 610 | * @return number of bytes written on success, #GNUNET_SYSERR on error |
622 | */ | 611 | */ |
623 | ssize_t | 612 | ssize_t |
624 | GNUNET_DISK_file_write_blocking (const struct GNUNET_DISK_FileHandle *h, | 613 | GNUNET_DISK_file_write_blocking(const struct GNUNET_DISK_FileHandle *h, |
625 | const void *buffer, | 614 | const void *buffer, |
626 | size_t n); | 615 | size_t n); |
627 | 616 | ||
628 | 617 | ||
629 | /** | 618 | /** |
@@ -637,10 +626,10 @@ GNUNET_DISK_file_write_blocking (const struct GNUNET_DISK_FileHandle *h, | |||
637 | * @return number of bytes written on success, #GNUNET_SYSERR on error | 626 | * @return number of bytes written on success, #GNUNET_SYSERR on error |
638 | */ | 627 | */ |
639 | ssize_t | 628 | ssize_t |
640 | GNUNET_DISK_fn_write (const char *fn, | 629 | GNUNET_DISK_fn_write(const char *fn, |
641 | const void *buffer, | 630 | const void *buffer, |
642 | size_t n, | 631 | size_t n, |
643 | enum GNUNET_DISK_AccessPermissions mode); | 632 | enum GNUNET_DISK_AccessPermissions mode); |
644 | 633 | ||
645 | 634 | ||
646 | /** | 635 | /** |
@@ -651,8 +640,8 @@ GNUNET_DISK_fn_write (const char *fn, | |||
651 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 640 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
652 | */ | 641 | */ |
653 | int | 642 | int |
654 | GNUNET_DISK_file_copy (const char *src, | 643 | GNUNET_DISK_file_copy(const char *src, |
655 | const char *dst); | 644 | const char *dst); |
656 | 645 | ||
657 | 646 | ||
658 | /** | 647 | /** |
@@ -664,9 +653,9 @@ GNUNET_DISK_file_copy (const char *src, | |||
664 | * @return the number of files found, -1 on error | 653 | * @return the number of files found, -1 on error |
665 | */ | 654 | */ |
666 | int | 655 | int |
667 | GNUNET_DISK_directory_scan (const char *dir_name, | 656 | GNUNET_DISK_directory_scan(const char *dir_name, |
668 | GNUNET_FileNameCallback callback, | 657 | GNUNET_FileNameCallback callback, |
669 | void *callback_cls); | 658 | void *callback_cls); |
670 | 659 | ||
671 | 660 | ||
672 | /** | 661 | /** |
@@ -678,7 +667,7 @@ GNUNET_DISK_directory_scan (const char *dir_name, | |||
678 | * #GNUNET_NO if directory exists but is not writeable | 667 | * #GNUNET_NO if directory exists but is not writeable |
679 | */ | 668 | */ |
680 | int | 669 | int |
681 | GNUNET_DISK_directory_create_for_file (const char *filename); | 670 | GNUNET_DISK_directory_create_for_file(const char *filename); |
682 | 671 | ||
683 | 672 | ||
684 | /** | 673 | /** |
@@ -694,7 +683,7 @@ GNUNET_DISK_directory_create_for_file (const char *filename); | |||
694 | * does not exist or `stat`ed | 683 | * does not exist or `stat`ed |
695 | */ | 684 | */ |
696 | int | 685 | int |
697 | GNUNET_DISK_directory_test (const char *fil, int is_readable); | 686 | GNUNET_DISK_directory_test(const char *fil, int is_readable); |
698 | 687 | ||
699 | 688 | ||
700 | /** | 689 | /** |
@@ -705,7 +694,7 @@ GNUNET_DISK_directory_test (const char *fil, int is_readable); | |||
705 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 694 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
706 | */ | 695 | */ |
707 | int | 696 | int |
708 | GNUNET_DISK_directory_remove (const char *filename); | 697 | GNUNET_DISK_directory_remove(const char *filename); |
709 | 698 | ||
710 | 699 | ||
711 | /** | 700 | /** |
@@ -716,8 +705,8 @@ GNUNET_DISK_directory_remove (const char *filename); | |||
716 | * @param option option with the dir name to purge | 705 | * @param option option with the dir name to purge |
717 | */ | 706 | */ |
718 | void | 707 | void |
719 | GNUNET_DISK_purge_cfg_dir (const char *cfg_filename, | 708 | GNUNET_DISK_purge_cfg_dir(const char *cfg_filename, |
720 | const char *option); | 709 | const char *option); |
721 | 710 | ||
722 | 711 | ||
723 | /** | 712 | /** |
@@ -727,7 +716,7 @@ GNUNET_DISK_purge_cfg_dir (const char *cfg_filename, | |||
727 | * @returns #GNUNET_SYSERR on failure, #GNUNET_OK otherwise | 716 | * @returns #GNUNET_SYSERR on failure, #GNUNET_OK otherwise |
728 | */ | 717 | */ |
729 | int | 718 | int |
730 | GNUNET_DISK_directory_create (const char *dir); | 719 | GNUNET_DISK_directory_create(const char *dir); |
731 | 720 | ||
732 | 721 | ||
733 | /** | 722 | /** |
@@ -740,9 +729,9 @@ GNUNET_DISK_directory_create (const char *dir); | |||
740 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 729 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
741 | */ | 730 | */ |
742 | int | 731 | int |
743 | GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, | 732 | GNUNET_DISK_file_lock(struct GNUNET_DISK_FileHandle *fh, |
744 | off_t lock_start, | 733 | off_t lock_start, |
745 | off_t lock_end, int excl); | 734 | off_t lock_end, int excl); |
746 | 735 | ||
747 | 736 | ||
748 | /** | 737 | /** |
@@ -754,9 +743,9 @@ GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, | |||
754 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 743 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
755 | */ | 744 | */ |
756 | int | 745 | int |
757 | GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, | 746 | GNUNET_DISK_file_unlock(struct GNUNET_DISK_FileHandle *fh, |
758 | off_t unlock_start, | 747 | off_t unlock_start, |
759 | off_t unlock_end); | 748 | off_t unlock_end); |
760 | 749 | ||
761 | 750 | ||
762 | /** | 751 | /** |
@@ -764,7 +753,7 @@ GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, | |||
764 | * @param fn the filename to canonicalize | 753 | * @param fn the filename to canonicalize |
765 | */ | 754 | */ |
766 | void | 755 | void |
767 | GNUNET_DISK_filename_canonicalize (char *fn); | 756 | GNUNET_DISK_filename_canonicalize(char *fn); |
768 | 757 | ||
769 | 758 | ||
770 | /** | 759 | /** |
@@ -774,8 +763,8 @@ GNUNET_DISK_filename_canonicalize (char *fn); | |||
774 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 763 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
775 | */ | 764 | */ |
776 | int | 765 | int |
777 | GNUNET_DISK_file_change_owner (const char *filename, | 766 | GNUNET_DISK_file_change_owner(const char *filename, |
778 | const char *user); | 767 | const char *user); |
779 | 768 | ||
780 | 769 | ||
781 | /** | 770 | /** |
@@ -793,10 +782,10 @@ struct GNUNET_DISK_MapHandle; | |||
793 | * @return pointer to the mapped memory region, NULL on failure | 782 | * @return pointer to the mapped memory region, NULL on failure |
794 | */ | 783 | */ |
795 | void * | 784 | void * |
796 | GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, | 785 | GNUNET_DISK_file_map(const struct GNUNET_DISK_FileHandle *h, |
797 | struct GNUNET_DISK_MapHandle **m, | 786 | struct GNUNET_DISK_MapHandle **m, |
798 | enum GNUNET_DISK_MapType access, | 787 | enum GNUNET_DISK_MapType access, |
799 | size_t len); | 788 | size_t len); |
800 | 789 | ||
801 | 790 | ||
802 | /** | 791 | /** |
@@ -806,7 +795,7 @@ GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, | |||
806 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 795 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
807 | */ | 796 | */ |
808 | int | 797 | int |
809 | GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h); | 798 | GNUNET_DISK_file_unmap(struct GNUNET_DISK_MapHandle *h); |
810 | 799 | ||
811 | 800 | ||
812 | /** | 801 | /** |
@@ -816,7 +805,7 @@ GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h); | |||
816 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 805 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
817 | */ | 806 | */ |
818 | int | 807 | int |
819 | GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h); | 808 | GNUNET_DISK_file_sync(const struct GNUNET_DISK_FileHandle *h); |
820 | 809 | ||
821 | 810 | ||
822 | #if 0 /* keep Emacsens' auto-indent happy */ | 811 | #if 0 /* keep Emacsens' auto-indent happy */ |