diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-06 11:16:26 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-06 11:16:26 +0000 |
commit | 2ebfdbbe8af9eef26ad1a2776a20227715560558 (patch) | |
tree | 9ce4e1f88ab32a156653dc6d74a9c02a82c77ee1 /src/include | |
parent | b0f956058355ea7e96a7d3022b08dd951acd99a5 (diff) | |
download | gnunet-2ebfdbbe8af9eef26ad1a2776a20227715560558.tar.gz gnunet-2ebfdbbe8af9eef26ad1a2776a20227715560558.zip |
-load revocations from disk, misc doxygen/style fixes
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_configuration_lib.h | 11 | ||||
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 54 | ||||
-rw-r--r-- | src/include/gnunet_disk_lib.h | 49 |
3 files changed, 64 insertions, 50 deletions
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index 10cfc4138..05ba8a2db 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h | |||
@@ -324,9 +324,10 @@ GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
324 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 324 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
325 | */ | 325 | */ |
326 | int | 326 | int |
327 | GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle | 327 | GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle *cfg, |
328 | *cfg, const char *section, | 328 | const char *section, |
329 | const char *option, char **value); | 329 | const char *option, |
330 | char **value); | ||
330 | 331 | ||
331 | 332 | ||
332 | /** | 333 | /** |
@@ -341,11 +342,11 @@ GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle | |||
341 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 342 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
342 | */ | 343 | */ |
343 | int | 344 | int |
344 | GNUNET_CONFIGURATION_get_value_filename (const struct | 345 | GNUNET_CONFIGURATION_get_value_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, |
345 | GNUNET_CONFIGURATION_Handle *cfg, | ||
346 | const char *section, | 346 | const char *section, |
347 | const char *option, char **value); | 347 | const char *option, char **value); |
348 | 348 | ||
349 | |||
349 | /** | 350 | /** |
350 | * Iterate over the set of filenames stored in a configuration value. | 351 | * Iterate over the set of filenames stored in a configuration value. |
351 | * | 352 | * |
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index c72c135c1..eda23077b 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -189,7 +189,6 @@ struct GNUNET_CRYPTO_EccPublicSignKey | |||
189 | }; | 189 | }; |
190 | 190 | ||
191 | 191 | ||
192 | |||
193 | /** | 192 | /** |
194 | * The identity of the host (wraps the signing key of the peer). | 193 | * The identity of the host (wraps the signing key of the peer). |
195 | */ | 194 | */ |
@@ -296,7 +295,7 @@ GNUNET_CRYPTO_seed_weak_random (int32_t seed); | |||
296 | * @param sum current sum, initially 0 | 295 | * @param sum current sum, initially 0 |
297 | * @param buf buffer to calculate CRC over (must be 16-bit aligned) | 296 | * @param buf buffer to calculate CRC over (must be 16-bit aligned) |
298 | * @param len number of bytes in @a buf, must be multiple of 2 | 297 | * @param len number of bytes in @a buf, must be multiple of 2 |
299 | * @return updated crc sum (must be subjected to GNUNET_CRYPTO_crc16_finish to get actual crc16) | 298 | * @return updated crc sum (must be subjected to #GNUNET_CRYPTO_crc16_finish to get actual crc16) |
300 | */ | 299 | */ |
301 | uint32_t | 300 | uint32_t |
302 | GNUNET_CRYPTO_crc16_step (uint32_t sum, const void *buf, size_t len); | 301 | GNUNET_CRYPTO_crc16_step (uint32_t sum, const void *buf, size_t len); |
@@ -426,7 +425,7 @@ GNUNET_CRYPTO_symmetric_decrypt (const void *block, size_t size, | |||
426 | * @param iv initialization vector | 425 | * @param iv initialization vector |
427 | * @param skey session key | 426 | * @param skey session key |
428 | * @param salt salt for the derivation | 427 | * @param salt salt for the derivation |
429 | * @param salt_len size of the salt | 428 | * @param salt_len size of the @a salt |
430 | * @param ... pairs of void * & size_t for context chunks, terminated by NULL | 429 | * @param ... pairs of void * & size_t for context chunks, terminated by NULL |
431 | */ | 430 | */ |
432 | void | 431 | void |
@@ -441,7 +440,7 @@ GNUNET_CRYPTO_symmetric_derive_iv (struct GNUNET_CRYPTO_SymmetricInitializationV | |||
441 | * @param iv initialization vector | 440 | * @param iv initialization vector |
442 | * @param skey session key | 441 | * @param skey session key |
443 | * @param salt salt for the derivation | 442 | * @param salt salt for the derivation |
444 | * @param salt_len size of the salt | 443 | * @param salt_len size of the @a salt |
445 | * @param argp pairs of void * & size_t for context chunks, terminated by NULL | 444 | * @param argp pairs of void * & size_t for context chunks, terminated by NULL |
446 | */ | 445 | */ |
447 | void | 446 | void |
@@ -494,7 +493,7 @@ GNUNET_CRYPTO_hash_from_string2 (const char *enc, size_t enclen, | |||
494 | * @ingroup hash | 493 | * @ingroup hash |
495 | * | 494 | * |
496 | * Compute the distance between 2 hashcodes. The | 495 | * Compute the distance between 2 hashcodes. The |
497 | * computation must be fast, not involve a[0] or a[4] (they're used | 496 | * computation must be fast, not involve @a a[0] or @a a[4] (they're used |
498 | * elsewhere), and be somewhat consistent. And of course, the result | 497 | * elsewhere), and be somewhat consistent. And of course, the result |
499 | * should be a positive number. | 498 | * should be a positive number. |
500 | * | 499 | * |
@@ -503,8 +502,8 @@ GNUNET_CRYPTO_hash_from_string2 (const char *enc, size_t enclen, | |||
503 | * @return number between 0 and UINT32_MAX | 502 | * @return number between 0 and UINT32_MAX |
504 | */ | 503 | */ |
505 | uint32_t | 504 | uint32_t |
506 | GNUNET_CRYPTO_hash_distance_u32 (const struct GNUNET_HashCode * a, | 505 | GNUNET_CRYPTO_hash_distance_u32 (const struct GNUNET_HashCode *a, |
507 | const struct GNUNET_HashCode * b); | 506 | const struct GNUNET_HashCode *b); |
508 | 507 | ||
509 | 508 | ||
510 | /** | 509 | /** |
@@ -542,8 +541,7 @@ GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, | |||
542 | * @param res resulting hash, NULL on error | 541 | * @param res resulting hash, NULL on error |
543 | */ | 542 | */ |
544 | typedef void (*GNUNET_CRYPTO_HashCompletedCallback) (void *cls, | 543 | typedef void (*GNUNET_CRYPTO_HashCompletedCallback) (void *cls, |
545 | const struct GNUNET_HashCode * | 544 | const struct GNUNET_HashCode *res); |
546 | res); | ||
547 | 545 | ||
548 | 546 | ||
549 | /** | 547 | /** |
@@ -593,30 +591,30 @@ GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, | |||
593 | 591 | ||
594 | /** | 592 | /** |
595 | * @ingroup hash | 593 | * @ingroup hash |
596 | * compute result(delta) = b - a | 594 | * compute @a result = @a b - @a a |
597 | * | 595 | * |
598 | * @param a some hash code | 596 | * @param a some hash code |
599 | * @param b some hash code | 597 | * @param b some hash code |
600 | * @param result set to @a b - @a a | 598 | * @param result set to @a b - @a a |
601 | */ | 599 | */ |
602 | void | 600 | void |
603 | GNUNET_CRYPTO_hash_difference (const struct GNUNET_HashCode * a, | 601 | GNUNET_CRYPTO_hash_difference (const struct GNUNET_HashCode *a, |
604 | const struct GNUNET_HashCode * b, | 602 | const struct GNUNET_HashCode *b, |
605 | struct GNUNET_HashCode * result); | 603 | struct GNUNET_HashCode *result); |
606 | 604 | ||
607 | 605 | ||
608 | /** | 606 | /** |
609 | * @ingroup hash | 607 | * @ingroup hash |
610 | * compute result(b) = a + delta | 608 | * compute @a result = @a a + @a delta |
611 | * | 609 | * |
612 | * @param a some hash code | 610 | * @param a some hash code |
613 | * @param delta some hash code | 611 | * @param delta some hash code |
614 | * @param result set to @a a + @a delta | 612 | * @param result set to @a a + @a delta |
615 | */ | 613 | */ |
616 | void | 614 | void |
617 | GNUNET_CRYPTO_hash_sum (const struct GNUNET_HashCode * a, | 615 | GNUNET_CRYPTO_hash_sum (const struct GNUNET_HashCode *a, |
618 | const struct GNUNET_HashCode * delta, | 616 | const struct GNUNET_HashCode *delta, |
619 | struct GNUNET_HashCode * result); | 617 | struct GNUNET_HashCode *result); |
620 | 618 | ||
621 | 619 | ||
622 | /** | 620 | /** |
@@ -643,8 +641,7 @@ GNUNET_CRYPTO_hash_xor (const struct GNUNET_HashCode * a, const struct GNUNET_Ha | |||
643 | void | 641 | void |
644 | GNUNET_CRYPTO_hash_to_aes_key (const struct GNUNET_HashCode * hc, | 642 | GNUNET_CRYPTO_hash_to_aes_key (const struct GNUNET_HashCode * hc, |
645 | struct GNUNET_CRYPTO_SymmetricSessionKey *skey, | 643 | struct GNUNET_CRYPTO_SymmetricSessionKey *skey, |
646 | struct GNUNET_CRYPTO_SymmetricInitializationVector | 644 | struct GNUNET_CRYPTO_SymmetricInitializationVector *iv); |
647 | *iv); | ||
648 | 645 | ||
649 | 646 | ||
650 | /** | 647 | /** |
@@ -663,7 +660,7 @@ GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode *code, | |||
663 | /** | 660 | /** |
664 | * @ingroup hash | 661 | * @ingroup hash |
665 | * Determine how many low order bits match in two | 662 | * Determine how many low order bits match in two |
666 | * struct GNUNET_HashCodes. i.e. - 010011 and 011111 share | 663 | * `struct GNUNET_HashCodes`. i.e. - 010011 and 011111 share |
667 | * the first two lowest order bits, and therefore the | 664 | * the first two lowest order bits, and therefore the |
668 | * return value is two (NOT XOR distance, nor how many | 665 | * return value is two (NOT XOR distance, nor how many |
669 | * bits match absolutely!). | 666 | * bits match absolutely!). |
@@ -673,8 +670,8 @@ GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode *code, | |||
673 | * @return the number of bits that match | 670 | * @return the number of bits that match |
674 | */ | 671 | */ |
675 | unsigned int | 672 | unsigned int |
676 | GNUNET_CRYPTO_hash_matching_bits (const struct GNUNET_HashCode * first, | 673 | GNUNET_CRYPTO_hash_matching_bits (const struct GNUNET_HashCode *first, |
677 | const struct GNUNET_HashCode * second); | 674 | const struct GNUNET_HashCode *second); |
678 | 675 | ||
679 | 676 | ||
680 | /** | 677 | /** |
@@ -684,10 +681,11 @@ GNUNET_CRYPTO_hash_matching_bits (const struct GNUNET_HashCode * first, | |||
684 | * | 681 | * |
685 | * @param h1 some hash code | 682 | * @param h1 some hash code |
686 | * @param h2 some hash code | 683 | * @param h2 some hash code |
687 | * @return 1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2. | 684 | * @return 1 if @a h1 > @a h2, -1 if @a h1 < @a h2 and 0 if @a h1 == @a h2. |
688 | */ | 685 | */ |
689 | int | 686 | int |
690 | GNUNET_CRYPTO_hash_cmp (const struct GNUNET_HashCode * h1, const struct GNUNET_HashCode * h2); | 687 | GNUNET_CRYPTO_hash_cmp (const struct GNUNET_HashCode *h1, |
688 | const struct GNUNET_HashCode *h2); | ||
691 | 689 | ||
692 | 690 | ||
693 | /** | 691 | /** |
@@ -698,12 +696,12 @@ GNUNET_CRYPTO_hash_cmp (const struct GNUNET_HashCode * h1, const struct GNUNET_H | |||
698 | * @param h1 some hash code | 696 | * @param h1 some hash code |
699 | * @param h2 some hash code | 697 | * @param h2 some hash code |
700 | * @param target some hash code | 698 | * @param target some hash code |
701 | * @return -1 if h1 is closer, 1 if h2 is closer and 0 if h1==h2. | 699 | * @return -1 if @a h1 is closer, 1 if @a h2 is closer and 0 if @a h1== @a h2. |
702 | */ | 700 | */ |
703 | int | 701 | int |
704 | GNUNET_CRYPTO_hash_xorcmp (const struct GNUNET_HashCode * h1, | 702 | GNUNET_CRYPTO_hash_xorcmp (const struct GNUNET_HashCode *h1, |
705 | const struct GNUNET_HashCode * h2, | 703 | const struct GNUNET_HashCode *h2, |
706 | const struct GNUNET_HashCode * target); | 704 | const struct GNUNET_HashCode *target); |
707 | 705 | ||
708 | 706 | ||
709 | /** | 707 | /** |
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index a800010f8..b5f0ccdda 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h | |||
@@ -282,7 +282,7 @@ GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); | |||
282 | * (of a file that exists and that is not a directory). | 282 | * (of a file that exists and that is not a directory). |
283 | * | 283 | * |
284 | * @param fil filename to check | 284 | * @param fil filename to check |
285 | * @return GNUNET_YES if yes, GNUNET_NO if not a file, GNUNET_SYSERR if something | 285 | * @return #GNUNET_YES if yes, #GNUNET_NO if not a file, #GNUNET_SYSERR if something |
286 | * else (will print an error message in that case, too). | 286 | * else (will print an error message in that case, too). |
287 | */ | 287 | */ |
288 | int | 288 | int |
@@ -320,15 +320,16 @@ GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, OFF_T offset, | |||
320 | * @param size set to the size of the file (or, | 320 | * @param size set to the size of the file (or, |
321 | * in the case of directories, the sum | 321 | * in the case of directories, the sum |
322 | * of all sizes of files in the directory) | 322 | * of all sizes of files in the directory) |
323 | * @param includeSymLinks should symbolic links be | 323 | * @param include_symbolic_links should symbolic links be |
324 | * included? | 324 | * included? |
325 | * @param singleFileMode GNUNET_YES to only get size of one file | 325 | * @param single_file_mode #GNUNET_YES to only get size of one file |
326 | * and return GNUNET_SYSERR for directories. | 326 | * and return #GNUNET_SYSERR for directories. |
327 | * @return GNUNET_SYSERR on error, GNUNET_OK on success | 327 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
328 | */ | 328 | */ |
329 | int | 329 | int |
330 | GNUNET_DISK_file_size (const char *filename, uint64_t * size, | 330 | GNUNET_DISK_file_size (const char *filename, uint64_t *size, |
331 | int includeSymLinks, int singleFileMode); | 331 | int include_symbolic_links, |
332 | int single_file_mode); | ||
332 | 333 | ||
333 | 334 | ||
334 | /** | 335 | /** |
@@ -347,8 +348,9 @@ GNUNET_DISK_file_size (const char *filename, uint64_t * size, | |||
347 | * @return GNUNET_OK on success | 348 | * @return GNUNET_OK on success |
348 | */ | 349 | */ |
349 | int | 350 | int |
350 | GNUNET_DISK_file_get_identifiers (const char *filename, uint64_t * dev, | 351 | GNUNET_DISK_file_get_identifiers (const char *filename, |
351 | uint64_t * ino); | 352 | uint64_t *dev, |
353 | uint64_t *ino); | ||
352 | 354 | ||
353 | 355 | ||
354 | /** | 356 | /** |
@@ -392,7 +394,8 @@ GNUNET_DISK_mkdtemp (const char *t); | |||
392 | * @return IO handle on success, NULL on error | 394 | * @return IO handle on success, NULL on error |
393 | */ | 395 | */ |
394 | struct GNUNET_DISK_FileHandle * | 396 | struct GNUNET_DISK_FileHandle * |
395 | GNUNET_DISK_file_open (const char *fn, enum GNUNET_DISK_OpenFlags flags, | 397 | GNUNET_DISK_file_open (const char *fn, |
398 | enum GNUNET_DISK_OpenFlags flags, | ||
396 | enum GNUNET_DISK_AccessPermissions perm); | 399 | enum GNUNET_DISK_AccessPermissions perm); |
397 | 400 | ||
398 | 401 | ||
@@ -418,7 +421,10 @@ GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh, | |||
418 | * @return handle to the new pipe, NULL on error | 421 | * @return handle to the new pipe, NULL on error |
419 | */ | 422 | */ |
420 | struct GNUNET_DISK_PipeHandle * | 423 | struct GNUNET_DISK_PipeHandle * |
421 | GNUNET_DISK_pipe (int blocking_read, int blocking_write, int inherit_read, int inherit_write); | 424 | GNUNET_DISK_pipe (int blocking_read, |
425 | int blocking_write, | ||
426 | int inherit_read, | ||
427 | int inherit_write); | ||
422 | 428 | ||
423 | 429 | ||
424 | /** | 430 | /** |
@@ -432,7 +438,9 @@ GNUNET_DISK_pipe (int blocking_read, int blocking_write, int inherit_read, int i | |||
432 | * @return handle to the new pipe, NULL on error | 438 | * @return handle to the new pipe, NULL on error |
433 | */ | 439 | */ |
434 | struct GNUNET_DISK_PipeHandle * | 440 | struct GNUNET_DISK_PipeHandle * |
435 | GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2]); | 441 | GNUNET_DISK_pipe_from_fd (int blocking_read, |
442 | int blocking_write, | ||
443 | int fd[2]); | ||
436 | 444 | ||
437 | 445 | ||
438 | /** | 446 | /** |
@@ -529,13 +537,15 @@ GNUNET_DISK_get_handle_from_native (FILE *fd); | |||
529 | 537 | ||
530 | /** | 538 | /** |
531 | * Read the contents of a binary file into a buffer. | 539 | * Read the contents of a binary file into a buffer. |
540 | * | ||
532 | * @param h handle to an open file | 541 | * @param h handle to an open file |
533 | * @param result the buffer to write the result to | 542 | * @param result the buffer to write the result to |
534 | * @param len the maximum number of bytes to read | 543 | * @param len the maximum number of bytes to read |
535 | * @return the number of bytes read on success, #GNUNET_SYSERR on failure | 544 | * @return the number of bytes read on success, #GNUNET_SYSERR on failure |
536 | */ | 545 | */ |
537 | ssize_t | 546 | ssize_t |
538 | GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, void *result, | 547 | GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, |
548 | void *result, | ||
539 | size_t len); | 549 | size_t len); |
540 | 550 | ||
541 | 551 | ||
@@ -579,18 +589,20 @@ GNUNET_DISK_fn_read (const char *fn, | |||
579 | */ | 589 | */ |
580 | ssize_t | 590 | ssize_t |
581 | GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, | 591 | GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, |
582 | const void *buffer, size_t n); | 592 | const void *buffer, |
593 | size_t n); | ||
583 | 594 | ||
584 | 595 | ||
585 | /** | 596 | /** |
586 | * Write a buffer to a file, blocking, if necessary. | 597 | * Write a buffer to a file, blocking, if necessary. |
598 | * | ||
587 | * @param h handle to open file | 599 | * @param h handle to open file |
588 | * @param buffer the data to write | 600 | * @param buffer the data to write |
589 | * @param n number of bytes to write | 601 | * @param n number of bytes to write |
590 | * @return number of bytes written on success, #GNUNET_SYSERR on error | 602 | * @return number of bytes written on success, #GNUNET_SYSERR on error |
591 | */ | 603 | */ |
592 | ssize_t | 604 | ssize_t |
593 | GNUNET_DISK_file_write_blocking (const struct GNUNET_DISK_FileHandle * h, | 605 | GNUNET_DISK_file_write_blocking (const struct GNUNET_DISK_FileHandle *h, |
594 | const void *buffer, | 606 | const void *buffer, |
595 | size_t n); | 607 | size_t n); |
596 | 608 | ||
@@ -606,7 +618,9 @@ GNUNET_DISK_file_write_blocking (const struct GNUNET_DISK_FileHandle * h, | |||
606 | * @return number of bytes written on success, #GNUNET_SYSERR on error | 618 | * @return number of bytes written on success, #GNUNET_SYSERR on error |
607 | */ | 619 | */ |
608 | ssize_t | 620 | ssize_t |
609 | GNUNET_DISK_fn_write (const char *fn, const void *buffer, size_t n, | 621 | GNUNET_DISK_fn_write (const char *fn, |
622 | const void *buffer, | ||
623 | size_t n, | ||
610 | enum GNUNET_DISK_AccessPermissions mode); | 624 | enum GNUNET_DISK_AccessPermissions mode); |
611 | 625 | ||
612 | 626 | ||
@@ -766,7 +780,8 @@ GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, | |||
766 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 780 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
767 | */ | 781 | */ |
768 | int | 782 | int |
769 | GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, OFF_T unlock_start, | 783 | GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, |
784 | OFF_T unlock_start, | ||
770 | OFF_T unlock_end); | 785 | OFF_T unlock_end); |
771 | 786 | ||
772 | 787 | ||