diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-06-24 13:39:32 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-06-24 13:39:32 +0000 |
commit | a913b5f73410eb3f0568670046d3ecf3b233744f (patch) | |
tree | dcb13bbc2aa2ed6c23832e4c55a0f843c0a68f31 /src/util/common_logging.c | |
parent | b2b1773aaa6e7c0c61ff7ac5a5766a8a2ea25495 (diff) | |
download | gnunet-a913b5f73410eb3f0568670046d3ecf3b233744f.tar.gz gnunet-a913b5f73410eb3f0568670046d3ecf3b233744f.zip |
stuff
Diffstat (limited to 'src/util/common_logging.c')
-rw-r--r-- | src/util/common_logging.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index c77464eb5..a1a60b800 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -381,6 +381,24 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind) | |||
381 | 381 | ||
382 | 382 | ||
383 | /** | 383 | /** |
384 | * Convert a hash to a string (for printing debug messages). | ||
385 | * This is one of the very few calls in the entire API that is | ||
386 | * NOT reentrant! | ||
387 | * | ||
388 | * @param pid the peer identity | ||
389 | * @return string form; will be overwritten by next call to GNUNET_h2s. | ||
390 | */ | ||
391 | const char * | ||
392 | GNUNET_h2s (const GNUNET_HashCode *pid) | ||
393 | { | ||
394 | static struct GNUNET_CRYPTO_HashAsciiEncoded ret; | ||
395 | GNUNET_CRYPTO_hash_to_enc (pid, &ret); | ||
396 | ret.encoding[8] = '\0'; | ||
397 | return (const char *) ret.encoding; | ||
398 | } | ||
399 | |||
400 | |||
401 | /** | ||
384 | * Convert a peer identity to a string (for printing debug messages). | 402 | * Convert a peer identity to a string (for printing debug messages). |
385 | * This is one of the very few calls in the entire API that is | 403 | * This is one of the very few calls in the entire API that is |
386 | * NOT reentrant! | 404 | * NOT reentrant! |