aboutsummaryrefslogtreecommitdiff
path: root/src/util/common_logging.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-17 17:18:53 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-17 17:18:53 +0100
commitf9b01d9c8eeac932db6357426f8a70bf525a4e07 (patch)
treef3023b6cfe959a38ed5d9ab131fc8e1c62d136ea /src/util/common_logging.c
parent100e16ba31dac7138413bda3389d30b3575a8b8e (diff)
downloadgnunet-f9b01d9c8eeac932db6357426f8a70bf525a4e07.tar.gz
gnunet-f9b01d9c8eeac932db6357426f8a70bf525a4e07.zip
use new shortmap to simplify CADET logic a bit
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r--src/util/common_logging.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index 5989db00c..ce229826e 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -1153,6 +1153,29 @@ GNUNET_h2s (const struct GNUNET_HashCode * hc)
1153 1153
1154 1154
1155/** 1155/**
1156 * @ingroup logging
1157 * Convert a short hash value to a string (for printing debug messages).
1158 * This is one of the very few calls in the entire API that is
1159 * NOT reentrant!
1160 *
1161 * @param shc the hash code
1162 * @return string
1163 */
1164const char *
1165GNUNET_sh2s (const struct GNUNET_ShortHashCode *shc)
1166{
1167 static char buf[32];
1168
1169 GNUNET_STRINGS_data_to_string (shc,
1170 sizeof (*shc),
1171 buf,
1172 sizeof (buf));
1173 buf[6] = '\0';
1174 return (const char *) buf;
1175}
1176
1177
1178/**
1156 * Convert a hash to a string (for printing debug messages). 1179 * Convert a hash to a string (for printing debug messages).
1157 * This is one of the very few calls in the entire API that is 1180 * This is one of the very few calls in the entire API that is
1158 * NOT reentrant! 1181 * NOT reentrant!