aboutsummaryrefslogtreecommitdiff
path: root/src/util/common_logging.c
diff options
context:
space:
mode:
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!