diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-02-25 00:46:09 +0100 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2022-02-25 08:48:59 +0100 |
commit | 5e4cbb92beb575ad5b072334b42d66feb0f0c331 (patch) | |
tree | a1f7e1ae5f77e09e94329ba1cbe6ebb3fc0ba690 /src/include/gnunet_common.h | |
parent | 86e73d58ffc79ea706a5bc83867de3def4eaba48 (diff) | |
download | gnunet-5e4cbb92beb575ad5b072334b42d66feb0f0c331.tar.gz gnunet-5e4cbb92beb575ad5b072334b42d66feb0f0c331.zip |
add GNUNET_B2S() macro; fix dht_line_test: we sign over query_hash, not block key
Diffstat (limited to 'src/include/gnunet_common.h')
-rw-r--r-- | src/include/gnunet_common.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index 4472d3ee8..9bcd99c7b 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h | |||
@@ -623,6 +623,31 @@ GNUNET_abort_ (void) GNUNET_NORETURN; | |||
623 | 623 | ||
624 | 624 | ||
625 | /** | 625 | /** |
626 | * Convert a buffer to an 8-character string | ||
627 | * representative of the contents. This is used | ||
628 | * for logging binary data when debugging. | ||
629 | * | ||
630 | * @param buf buffer to log | ||
631 | * @param buf_size number of bytes in @a buf | ||
632 | * @return text representation of buf, valid until next | ||
633 | * call to this function | ||
634 | */ | ||
635 | const char * | ||
636 | GNUNET_b2s (const void *buf, | ||
637 | size_t buf_size); | ||
638 | |||
639 | |||
640 | /** | ||
641 | * Convert a fixed-sized object to a string using | ||
642 | * #GNUNET_b2s(). | ||
643 | * | ||
644 | * @param obj address of object to convert | ||
645 | * @return string representing the binary obj buffer | ||
646 | */ | ||
647 | #define GNUNET_B2S(obj) GNUNET_b2s ((obj), sizeof (*(obj))) | ||
648 | |||
649 | |||
650 | /** | ||
626 | * @ingroup logging | 651 | * @ingroup logging |
627 | * Ignore the next @a n calls to the log function. | 652 | * Ignore the next @a n calls to the log function. |
628 | * | 653 | * |
@@ -1240,7 +1265,7 @@ GNUNET_is_zero_ (const void *a, | |||
1240 | * @return GNUNET_YES if a is zero, GNUNET_NO otherwise | 1265 | * @return GNUNET_YES if a is zero, GNUNET_NO otherwise |
1241 | */ | 1266 | */ |
1242 | #define GNUNET_is_zero(a) \ | 1267 | #define GNUNET_is_zero(a) \ |
1243 | GNUNET_is_zero_ (a, sizeof (*a)) | 1268 | GNUNET_is_zero_ ((a), sizeof (*(a))) |
1244 | 1269 | ||
1245 | 1270 | ||
1246 | /** | 1271 | /** |