[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: implement GNUNET_h2s2 for p
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: implement GNUNET_h2s2 for printing two hashes in one log output line |
Date: |
Sat, 08 Jul 2017 21:52:38 +0200 |
This is an automated email from the git hooks/post-receive script.
lurchi pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new cdf3b6745 implement GNUNET_h2s2 for printing two hashes in one log
output line
cdf3b6745 is described below
commit cdf3b6745f83502a6fd246cb92a225f09bc4de0d
Author: lurchi <address@hidden>
AuthorDate: Sat Jul 8 21:50:20 2017 +0200
implement GNUNET_h2s2 for printing two hashes in one log output line
---
src/util/common_logging.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index 34481fe13..33edb9b1a 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -1156,6 +1156,27 @@ GNUNET_h2s (const struct GNUNET_HashCode * hc)
/**
+ * Convert a hash to a string (for printing debug messages).
+ * This is one of the very few calls in the entire API that is
+ * NOT reentrant! Identical to #GNUNET_h2s(), except that another
+ * buffer is used so both #GNUNET_h2s() and #GNUNET_i2s2() can be
+ * used within the same log statement.
+ *
+ * @param hc the hash code
+ * @return string form; will be overwritten by next call to GNUNET_h2s.
+ */
+const char *
+GNUNET_h2s2 (const struct GNUNET_HashCode * hc)
+{
+ static struct GNUNET_CRYPTO_HashAsciiEncoded ret;
+
+ GNUNET_CRYPTO_hash_to_enc (hc, &ret);
+ ret.encoding[8] = '\0';
+ return (const char *) ret.encoding;
+}
+
+
+/**
* @ingroup logging
* Convert a short hash value to a string (for printing debug messages).
* This is one of the very few calls in the entire API that is
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: implement GNUNET_h2s2 for printing two hashes in one log output line,
gnunet <=