diff options
Diffstat (limited to 'src/include/gnunet_disk_lib.h')
-rw-r--r-- | src/include/gnunet_disk_lib.h | 189 |
1 files changed, 98 insertions, 91 deletions
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index d1e1e0333..9376a1059 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h | |||
@@ -38,7 +38,8 @@ 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 | { | ||
42 | /** | 43 | /** |
43 | * Handle represents an event. | 44 | * Handle represents an event. |
44 | */ | 45 | */ |
@@ -58,7 +59,8 @@ enum GNUNET_FILE_Type { | |||
58 | /** | 59 | /** |
59 | * Handle used to access files (and pipes). | 60 | * Handle used to access files (and pipes). |
60 | */ | 61 | */ |
61 | struct GNUNET_DISK_FileHandle { | 62 | struct GNUNET_DISK_FileHandle |
63 | { | ||
62 | /** | 64 | /** |
63 | * File handle on Unix-like systems. | 65 | * File handle on Unix-like systems. |
64 | */ | 66 | */ |
@@ -86,7 +88,8 @@ extern "C" | |||
86 | /** | 88 | /** |
87 | * Specifies how a file should be opened. | 89 | * Specifies how a file should be opened. |
88 | */ | 90 | */ |
89 | enum GNUNET_DISK_OpenFlags { | 91 | enum GNUNET_DISK_OpenFlags |
92 | { | ||
90 | /** | 93 | /** |
91 | * Open the file for reading | 94 | * Open the file for reading |
92 | */ | 95 | */ |
@@ -126,7 +129,8 @@ enum GNUNET_DISK_OpenFlags { | |||
126 | /** | 129 | /** |
127 | * Specifies what type of memory map is desired. | 130 | * Specifies what type of memory map is desired. |
128 | */ | 131 | */ |
129 | enum GNUNET_DISK_MapType { | 132 | enum GNUNET_DISK_MapType |
133 | { | ||
130 | /** | 134 | /** |
131 | * Read-only memory map. | 135 | * Read-only memory map. |
132 | */ | 136 | */ |
@@ -147,7 +151,8 @@ enum GNUNET_DISK_MapType { | |||
147 | /** | 151 | /** |
148 | * File access permissions, UNIX-style. | 152 | * File access permissions, UNIX-style. |
149 | */ | 153 | */ |
150 | enum GNUNET_DISK_AccessPermissions { | 154 | enum GNUNET_DISK_AccessPermissions |
155 | { | ||
151 | /** | 156 | /** |
152 | * Nobody is allowed to do anything to the file. | 157 | * Nobody is allowed to do anything to the file. |
153 | */ | 158 | */ |
@@ -204,7 +209,8 @@ enum GNUNET_DISK_AccessPermissions { | |||
204 | * Constants for specifying how to seek. Do not change values or order, | 209 | * Constants for specifying how to seek. Do not change values or order, |
205 | * some of the code depends on the specific numeric values! | 210 | * some of the code depends on the specific numeric values! |
206 | */ | 211 | */ |
207 | enum GNUNET_DISK_Seek { | 212 | enum GNUNET_DISK_Seek |
213 | { | ||
208 | /** | 214 | /** |
209 | * Seek an absolute position (from the start of the file). | 215 | * Seek an absolute position (from the start of the file). |
210 | */ | 216 | */ |
@@ -225,7 +231,8 @@ enum GNUNET_DISK_Seek { | |||
225 | /** | 231 | /** |
226 | * Enumeration identifying the two ends of a pipe. | 232 | * Enumeration identifying the two ends of a pipe. |
227 | */ | 233 | */ |
228 | enum GNUNET_DISK_PipeEnd { | 234 | enum GNUNET_DISK_PipeEnd |
235 | { | ||
229 | /** | 236 | /** |
230 | * The reading-end of a pipe. | 237 | * The reading-end of a pipe. |
231 | */ | 238 | */ |
@@ -245,7 +252,7 @@ enum GNUNET_DISK_PipeEnd { | |||
245 | * @return #GNUNET_YES if invalid, #GNUNET_NO if valid | 252 | * @return #GNUNET_YES if invalid, #GNUNET_NO if valid |
246 | */ | 253 | */ |
247 | int | 254 | int |
248 | GNUNET_DISK_handle_invalid(const struct GNUNET_DISK_FileHandle *h); | 255 | GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); |
249 | 256 | ||
250 | 257 | ||
251 | /** | 258 | /** |
@@ -257,7 +264,7 @@ GNUNET_DISK_handle_invalid(const struct GNUNET_DISK_FileHandle *h); | |||
257 | * else (will print an error message in that case, too). | 264 | * else (will print an error message in that case, too). |
258 | */ | 265 | */ |
259 | int | 266 | int |
260 | GNUNET_DISK_file_test(const char *fil); | 267 | GNUNET_DISK_file_test (const char *fil); |
261 | 268 | ||
262 | 269 | ||
263 | /** | 270 | /** |
@@ -268,7 +275,7 @@ GNUNET_DISK_file_test(const char *fil); | |||
268 | * @param fil name of the file to back up | 275 | * @param fil name of the file to back up |
269 | */ | 276 | */ |
270 | void | 277 | void |
271 | GNUNET_DISK_file_backup(const char *fil); | 278 | GNUNET_DISK_file_backup (const char *fil); |
272 | 279 | ||
273 | 280 | ||
274 | /** | 281 | /** |
@@ -279,8 +286,8 @@ GNUNET_DISK_file_backup(const char *fil); | |||
279 | * @return the new position on success, GNUNET_SYSERR otherwise | 286 | * @return the new position on success, GNUNET_SYSERR otherwise |
280 | */ | 287 | */ |
281 | off_t | 288 | off_t |
282 | GNUNET_DISK_file_seek(const struct GNUNET_DISK_FileHandle *h, off_t offset, | 289 | GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, off_t offset, |
283 | enum GNUNET_DISK_Seek whence); | 290 | enum GNUNET_DISK_Seek whence); |
284 | 291 | ||
285 | 292 | ||
286 | /** | 293 | /** |
@@ -298,10 +305,10 @@ GNUNET_DISK_file_seek(const struct GNUNET_DISK_FileHandle *h, off_t offset, | |||
298 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 305 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
299 | */ | 306 | */ |
300 | int | 307 | int |
301 | GNUNET_DISK_file_size(const char *filename, | 308 | GNUNET_DISK_file_size (const char *filename, |
302 | uint64_t *size, | 309 | uint64_t *size, |
303 | int include_symbolic_links, | 310 | int include_symbolic_links, |
304 | int single_file_mode); | 311 | int single_file_mode); |
305 | 312 | ||
306 | 313 | ||
307 | /** | 314 | /** |
@@ -320,9 +327,9 @@ GNUNET_DISK_file_size(const char *filename, | |||
320 | * @return #GNUNET_OK on success | 327 | * @return #GNUNET_OK on success |
321 | */ | 328 | */ |
322 | int | 329 | int |
323 | GNUNET_DISK_file_get_identifiers(const char *filename, | 330 | GNUNET_DISK_file_get_identifiers (const char *filename, |
324 | uint64_t *dev, | 331 | uint64_t *dev, |
325 | uint64_t *ino); | 332 | uint64_t *ino); |
326 | 333 | ||
327 | 334 | ||
328 | /** | 335 | /** |
@@ -337,7 +344,7 @@ GNUNET_DISK_file_get_identifiers(const char *filename, | |||
337 | * file on disk in directory for temporary files | 344 | * file on disk in directory for temporary files |
338 | */ | 345 | */ |
339 | char * | 346 | char * |
340 | GNUNET_DISK_mktemp(const char *t); | 347 | GNUNET_DISK_mktemp (const char *t); |
341 | 348 | ||
342 | 349 | ||
343 | /** | 350 | /** |
@@ -350,7 +357,7 @@ GNUNET_DISK_mktemp(const char *t); | |||
350 | * @return NULL on error, otherwise name of freshly created directory | 357 | * @return NULL on error, otherwise name of freshly created directory |
351 | */ | 358 | */ |
352 | char * | 359 | char * |
353 | GNUNET_DISK_mkdtemp(const char *t); | 360 | GNUNET_DISK_mkdtemp (const char *t); |
354 | 361 | ||
355 | 362 | ||
356 | /** | 363 | /** |
@@ -366,9 +373,9 @@ GNUNET_DISK_mkdtemp(const char *t); | |||
366 | * @return IO handle on success, NULL on error | 373 | * @return IO handle on success, NULL on error |
367 | */ | 374 | */ |
368 | struct GNUNET_DISK_FileHandle * | 375 | struct GNUNET_DISK_FileHandle * |
369 | GNUNET_DISK_file_open(const char *fn, | 376 | GNUNET_DISK_file_open (const char *fn, |
370 | enum GNUNET_DISK_OpenFlags flags, | 377 | enum GNUNET_DISK_OpenFlags flags, |
371 | enum GNUNET_DISK_AccessPermissions perm); | 378 | enum GNUNET_DISK_AccessPermissions perm); |
372 | 379 | ||
373 | 380 | ||
374 | /** | 381 | /** |
@@ -379,8 +386,8 @@ GNUNET_DISK_file_open(const char *fn, | |||
379 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 386 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
380 | */ | 387 | */ |
381 | int | 388 | int |
382 | GNUNET_DISK_file_handle_size(struct GNUNET_DISK_FileHandle *fh, | 389 | GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh, |
383 | off_t *size); | 390 | off_t *size); |
384 | 391 | ||
385 | 392 | ||
386 | /** | 393 | /** |
@@ -393,10 +400,10 @@ GNUNET_DISK_file_handle_size(struct GNUNET_DISK_FileHandle *fh, | |||
393 | * @return handle to the new pipe, NULL on error | 400 | * @return handle to the new pipe, NULL on error |
394 | */ | 401 | */ |
395 | struct GNUNET_DISK_PipeHandle * | 402 | struct GNUNET_DISK_PipeHandle * |
396 | GNUNET_DISK_pipe(int blocking_read, | 403 | GNUNET_DISK_pipe (int blocking_read, |
397 | int blocking_write, | 404 | int blocking_write, |
398 | int inherit_read, | 405 | int inherit_read, |
399 | int inherit_write); | 406 | int inherit_write); |
400 | 407 | ||
401 | 408 | ||
402 | /** | 409 | /** |
@@ -410,9 +417,9 @@ GNUNET_DISK_pipe(int blocking_read, | |||
410 | * @return handle to the new pipe, NULL on error | 417 | * @return handle to the new pipe, NULL on error |
411 | */ | 418 | */ |
412 | struct GNUNET_DISK_PipeHandle * | 419 | struct GNUNET_DISK_PipeHandle * |
413 | GNUNET_DISK_pipe_from_fd(int blocking_read, | 420 | GNUNET_DISK_pipe_from_fd (int blocking_read, |
414 | int blocking_write, | 421 | int blocking_write, |
415 | int fd[2]); | 422 | int fd[2]); |
416 | 423 | ||
417 | 424 | ||
418 | /** | 425 | /** |
@@ -421,7 +428,7 @@ GNUNET_DISK_pipe_from_fd(int blocking_read, | |||
421 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 428 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
422 | */ | 429 | */ |
423 | int | 430 | int |
424 | GNUNET_DISK_pipe_close(struct GNUNET_DISK_PipeHandle *p); | 431 | GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); |
425 | 432 | ||
426 | 433 | ||
427 | /** | 434 | /** |
@@ -432,8 +439,8 @@ GNUNET_DISK_pipe_close(struct GNUNET_DISK_PipeHandle *p); | |||
432 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 439 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
433 | */ | 440 | */ |
434 | int | 441 | int |
435 | GNUNET_DISK_pipe_close_end(struct GNUNET_DISK_PipeHandle *p, | 442 | GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, |
436 | enum GNUNET_DISK_PipeEnd end); | 443 | enum GNUNET_DISK_PipeEnd end); |
437 | 444 | ||
438 | 445 | ||
439 | /** | 446 | /** |
@@ -449,8 +456,8 @@ GNUNET_DISK_pipe_close_end(struct GNUNET_DISK_PipeHandle *p, | |||
449 | * (or if that end is not present or is closed). | 456 | * (or if that end is not present or is closed). |
450 | */ | 457 | */ |
451 | struct GNUNET_DISK_FileHandle * | 458 | struct GNUNET_DISK_FileHandle * |
452 | GNUNET_DISK_pipe_detach_end(struct GNUNET_DISK_PipeHandle *p, | 459 | GNUNET_DISK_pipe_detach_end (struct GNUNET_DISK_PipeHandle *p, |
453 | enum GNUNET_DISK_PipeEnd end); | 460 | enum GNUNET_DISK_PipeEnd end); |
454 | 461 | ||
455 | /** | 462 | /** |
456 | * Close an open file. | 463 | * Close an open file. |
@@ -459,7 +466,7 @@ GNUNET_DISK_pipe_detach_end(struct GNUNET_DISK_PipeHandle *p, | |||
459 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 466 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
460 | */ | 467 | */ |
461 | int | 468 | int |
462 | GNUNET_DISK_file_close(struct GNUNET_DISK_FileHandle *h); | 469 | GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); |
463 | 470 | ||
464 | 471 | ||
465 | /** | 472 | /** |
@@ -470,8 +477,8 @@ GNUNET_DISK_file_close(struct GNUNET_DISK_FileHandle *h); | |||
470 | * @return handle for the respective end | 477 | * @return handle for the respective end |
471 | */ | 478 | */ |
472 | const struct GNUNET_DISK_FileHandle * | 479 | const struct GNUNET_DISK_FileHandle * |
473 | GNUNET_DISK_pipe_handle(const struct GNUNET_DISK_PipeHandle *p, | 480 | GNUNET_DISK_pipe_handle (const struct GNUNET_DISK_PipeHandle *p, |
474 | enum GNUNET_DISK_PipeEnd n); | 481 | enum GNUNET_DISK_PipeEnd n); |
475 | 482 | ||
476 | /** | 483 | /** |
477 | * Update POSIX permissions mask of a file on disk. If both argumets | 484 | * Update POSIX permissions mask of a file on disk. If both argumets |
@@ -483,9 +490,9 @@ GNUNET_DISK_pipe_handle(const struct GNUNET_DISK_PipeHandle *p, | |||
483 | * @param require_gid_match #GNUNET_YES means 770 unless @a require_uid_match is set | 490 | * @param require_gid_match #GNUNET_YES means 770 unless @a require_uid_match is set |
484 | */ | 491 | */ |
485 | void | 492 | void |
486 | GNUNET_DISK_fix_permissions(const char *fn, | 493 | GNUNET_DISK_fix_permissions (const char *fn, |
487 | int require_uid_match, | 494 | int require_uid_match, |
488 | int require_gid_match); | 495 | int require_gid_match); |
489 | 496 | ||
490 | 497 | ||
491 | /** | 498 | /** |
@@ -495,7 +502,7 @@ GNUNET_DISK_fix_permissions(const char *fn, | |||
495 | * @return file handle corresponding to the descriptor | 502 | * @return file handle corresponding to the descriptor |
496 | */ | 503 | */ |
497 | struct GNUNET_DISK_FileHandle * | 504 | struct GNUNET_DISK_FileHandle * |
498 | GNUNET_DISK_get_handle_from_int_fd(int fno); | 505 | GNUNET_DISK_get_handle_from_int_fd (int fno); |
499 | 506 | ||
500 | 507 | ||
501 | /** | 508 | /** |
@@ -505,7 +512,7 @@ GNUNET_DISK_get_handle_from_int_fd(int fno); | |||
505 | * @return file handle corresponding to the descriptor | 512 | * @return file handle corresponding to the descriptor |
506 | */ | 513 | */ |
507 | struct GNUNET_DISK_FileHandle * | 514 | struct GNUNET_DISK_FileHandle * |
508 | GNUNET_DISK_get_handle_from_native(FILE *fd); | 515 | GNUNET_DISK_get_handle_from_native (FILE *fd); |
509 | 516 | ||
510 | 517 | ||
511 | /** | 518 | /** |
@@ -517,9 +524,9 @@ GNUNET_DISK_get_handle_from_native(FILE *fd); | |||
517 | * @return the number of bytes read on success, #GNUNET_SYSERR on failure | 524 | * @return the number of bytes read on success, #GNUNET_SYSERR on failure |
518 | */ | 525 | */ |
519 | ssize_t | 526 | ssize_t |
520 | GNUNET_DISK_file_read(const struct GNUNET_DISK_FileHandle *h, | 527 | GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, |
521 | void *result, | 528 | void *result, |
522 | size_t len); | 529 | size_t len); |
523 | 530 | ||
524 | 531 | ||
525 | /** | 532 | /** |
@@ -533,9 +540,9 @@ GNUNET_DISK_file_read(const struct GNUNET_DISK_FileHandle *h, | |||
533 | * @return the number of bytes read on success, #GNUNET_SYSERR on failure | 540 | * @return the number of bytes read on success, #GNUNET_SYSERR on failure |
534 | */ | 541 | */ |
535 | ssize_t | 542 | ssize_t |
536 | GNUNET_DISK_file_read_non_blocking(const struct GNUNET_DISK_FileHandle * h, | 543 | GNUNET_DISK_file_read_non_blocking (const struct GNUNET_DISK_FileHandle *h, |
537 | void *result, | 544 | void *result, |
538 | size_t len); | 545 | size_t len); |
539 | 546 | ||
540 | 547 | ||
541 | /** | 548 | /** |
@@ -547,9 +554,9 @@ GNUNET_DISK_file_read_non_blocking(const struct GNUNET_DISK_FileHandle * h, | |||
547 | * @return number of bytes read, #GNUNET_SYSERR on failure | 554 | * @return number of bytes read, #GNUNET_SYSERR on failure |
548 | */ | 555 | */ |
549 | ssize_t | 556 | ssize_t |
550 | GNUNET_DISK_fn_read(const char *fn, | 557 | GNUNET_DISK_fn_read (const char *fn, |
551 | void *result, | 558 | void *result, |
552 | size_t len); | 559 | size_t len); |
553 | 560 | ||
554 | 561 | ||
555 | /** | 562 | /** |
@@ -561,9 +568,9 @@ GNUNET_DISK_fn_read(const char *fn, | |||
561 | * @return number of bytes written on success, #GNUNET_SYSERR on error | 568 | * @return number of bytes written on success, #GNUNET_SYSERR on error |
562 | */ | 569 | */ |
563 | ssize_t | 570 | ssize_t |
564 | GNUNET_DISK_file_write(const struct GNUNET_DISK_FileHandle *h, | 571 | GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, |
565 | const void *buffer, | 572 | const void *buffer, |
566 | size_t n); | 573 | size_t n); |
567 | 574 | ||
568 | 575 | ||
569 | /** | 576 | /** |
@@ -575,9 +582,9 @@ GNUNET_DISK_file_write(const struct GNUNET_DISK_FileHandle *h, | |||
575 | * @return number of bytes written on success, #GNUNET_SYSERR on error | 582 | * @return number of bytes written on success, #GNUNET_SYSERR on error |
576 | */ | 583 | */ |
577 | ssize_t | 584 | ssize_t |
578 | GNUNET_DISK_file_write_blocking(const struct GNUNET_DISK_FileHandle *h, | 585 | GNUNET_DISK_file_write_blocking (const struct GNUNET_DISK_FileHandle *h, |
579 | const void *buffer, | 586 | const void *buffer, |
580 | size_t n); | 587 | size_t n); |
581 | 588 | ||
582 | 589 | ||
583 | /** | 590 | /** |
@@ -591,10 +598,10 @@ GNUNET_DISK_file_write_blocking(const struct GNUNET_DISK_FileHandle *h, | |||
591 | * @return number of bytes written on success, #GNUNET_SYSERR on error | 598 | * @return number of bytes written on success, #GNUNET_SYSERR on error |
592 | */ | 599 | */ |
593 | ssize_t | 600 | ssize_t |
594 | GNUNET_DISK_fn_write(const char *fn, | 601 | GNUNET_DISK_fn_write (const char *fn, |
595 | const void *buffer, | 602 | const void *buffer, |
596 | size_t n, | 603 | size_t n, |
597 | enum GNUNET_DISK_AccessPermissions mode); | 604 | enum GNUNET_DISK_AccessPermissions mode); |
598 | 605 | ||
599 | 606 | ||
600 | /** | 607 | /** |
@@ -605,8 +612,8 @@ GNUNET_DISK_fn_write(const char *fn, | |||
605 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 612 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
606 | */ | 613 | */ |
607 | int | 614 | int |
608 | GNUNET_DISK_file_copy(const char *src, | 615 | GNUNET_DISK_file_copy (const char *src, |
609 | const char *dst); | 616 | const char *dst); |
610 | 617 | ||
611 | 618 | ||
612 | /** | 619 | /** |
@@ -618,9 +625,9 @@ GNUNET_DISK_file_copy(const char *src, | |||
618 | * @return the number of files found, -1 on error | 625 | * @return the number of files found, -1 on error |
619 | */ | 626 | */ |
620 | int | 627 | int |
621 | GNUNET_DISK_directory_scan(const char *dir_name, | 628 | GNUNET_DISK_directory_scan (const char *dir_name, |
622 | GNUNET_FileNameCallback callback, | 629 | GNUNET_FileNameCallback callback, |
623 | void *callback_cls); | 630 | void *callback_cls); |
624 | 631 | ||
625 | 632 | ||
626 | /** | 633 | /** |
@@ -632,7 +639,7 @@ GNUNET_DISK_directory_scan(const char *dir_name, | |||
632 | * #GNUNET_NO if directory exists but is not writeable | 639 | * #GNUNET_NO if directory exists but is not writeable |
633 | */ | 640 | */ |
634 | int | 641 | int |
635 | GNUNET_DISK_directory_create_for_file(const char *filename); | 642 | GNUNET_DISK_directory_create_for_file (const char *filename); |
636 | 643 | ||
637 | 644 | ||
638 | /** | 645 | /** |
@@ -648,7 +655,7 @@ GNUNET_DISK_directory_create_for_file(const char *filename); | |||
648 | * does not exist or `stat`ed | 655 | * does not exist or `stat`ed |
649 | */ | 656 | */ |
650 | int | 657 | int |
651 | GNUNET_DISK_directory_test(const char *fil, int is_readable); | 658 | GNUNET_DISK_directory_test (const char *fil, int is_readable); |
652 | 659 | ||
653 | 660 | ||
654 | /** | 661 | /** |
@@ -659,7 +666,7 @@ GNUNET_DISK_directory_test(const char *fil, int is_readable); | |||
659 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 666 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
660 | */ | 667 | */ |
661 | int | 668 | int |
662 | GNUNET_DISK_directory_remove(const char *filename); | 669 | GNUNET_DISK_directory_remove (const char *filename); |
663 | 670 | ||
664 | 671 | ||
665 | /** | 672 | /** |
@@ -670,8 +677,8 @@ GNUNET_DISK_directory_remove(const char *filename); | |||
670 | * @param option option with the dir name to purge | 677 | * @param option option with the dir name to purge |
671 | */ | 678 | */ |
672 | void | 679 | void |
673 | GNUNET_DISK_purge_cfg_dir(const char *cfg_filename, | 680 | GNUNET_DISK_purge_cfg_dir (const char *cfg_filename, |
674 | const char *option); | 681 | const char *option); |
675 | 682 | ||
676 | 683 | ||
677 | /** | 684 | /** |
@@ -681,7 +688,7 @@ GNUNET_DISK_purge_cfg_dir(const char *cfg_filename, | |||
681 | * @returns #GNUNET_SYSERR on failure, #GNUNET_OK otherwise | 688 | * @returns #GNUNET_SYSERR on failure, #GNUNET_OK otherwise |
682 | */ | 689 | */ |
683 | int | 690 | int |
684 | GNUNET_DISK_directory_create(const char *dir); | 691 | GNUNET_DISK_directory_create (const char *dir); |
685 | 692 | ||
686 | 693 | ||
687 | /** | 694 | /** |
@@ -694,9 +701,9 @@ GNUNET_DISK_directory_create(const char *dir); | |||
694 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 701 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
695 | */ | 702 | */ |
696 | int | 703 | int |
697 | GNUNET_DISK_file_lock(struct GNUNET_DISK_FileHandle *fh, | 704 | GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, |
698 | off_t lock_start, | 705 | off_t lock_start, |
699 | off_t lock_end, int excl); | 706 | off_t lock_end, int excl); |
700 | 707 | ||
701 | 708 | ||
702 | /** | 709 | /** |
@@ -708,9 +715,9 @@ GNUNET_DISK_file_lock(struct GNUNET_DISK_FileHandle *fh, | |||
708 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 715 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
709 | */ | 716 | */ |
710 | int | 717 | int |
711 | GNUNET_DISK_file_unlock(struct GNUNET_DISK_FileHandle *fh, | 718 | GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, |
712 | off_t unlock_start, | 719 | off_t unlock_start, |
713 | off_t unlock_end); | 720 | off_t unlock_end); |
714 | 721 | ||
715 | 722 | ||
716 | /** | 723 | /** |
@@ -718,7 +725,7 @@ GNUNET_DISK_file_unlock(struct GNUNET_DISK_FileHandle *fh, | |||
718 | * @param fn the filename to canonicalize | 725 | * @param fn the filename to canonicalize |
719 | */ | 726 | */ |
720 | void | 727 | void |
721 | GNUNET_DISK_filename_canonicalize(char *fn); | 728 | GNUNET_DISK_filename_canonicalize (char *fn); |
722 | 729 | ||
723 | 730 | ||
724 | /** | 731 | /** |
@@ -728,8 +735,8 @@ GNUNET_DISK_filename_canonicalize(char *fn); | |||
728 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | 735 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure |
729 | */ | 736 | */ |
730 | int | 737 | int |
731 | GNUNET_DISK_file_change_owner(const char *filename, | 738 | GNUNET_DISK_file_change_owner (const char *filename, |
732 | const char *user); | 739 | const char *user); |
733 | 740 | ||
734 | 741 | ||
735 | /** | 742 | /** |
@@ -747,10 +754,10 @@ struct GNUNET_DISK_MapHandle; | |||
747 | * @return pointer to the mapped memory region, NULL on failure | 754 | * @return pointer to the mapped memory region, NULL on failure |
748 | */ | 755 | */ |
749 | void * | 756 | void * |
750 | GNUNET_DISK_file_map(const struct GNUNET_DISK_FileHandle *h, | 757 | GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, |
751 | struct GNUNET_DISK_MapHandle **m, | 758 | struct GNUNET_DISK_MapHandle **m, |
752 | enum GNUNET_DISK_MapType access, | 759 | enum GNUNET_DISK_MapType access, |
753 | size_t len); | 760 | size_t len); |
754 | 761 | ||
755 | 762 | ||
756 | /** | 763 | /** |
@@ -760,7 +767,7 @@ GNUNET_DISK_file_map(const struct GNUNET_DISK_FileHandle *h, | |||
760 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 767 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
761 | */ | 768 | */ |
762 | int | 769 | int |
763 | GNUNET_DISK_file_unmap(struct GNUNET_DISK_MapHandle *h); | 770 | GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h); |
764 | 771 | ||
765 | 772 | ||
766 | /** | 773 | /** |
@@ -770,7 +777,7 @@ GNUNET_DISK_file_unmap(struct GNUNET_DISK_MapHandle *h); | |||
770 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise | 777 | * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise |
771 | */ | 778 | */ |
772 | int | 779 | int |
773 | GNUNET_DISK_file_sync(const struct GNUNET_DISK_FileHandle *h); | 780 | GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h); |
774 | 781 | ||
775 | 782 | ||
776 | #if 0 /* keep Emacsens' auto-indent happy */ | 783 | #if 0 /* keep Emacsens' auto-indent happy */ |