From 7323230eb3c8fc4818d0cf34974497b3782a7279 Mon Sep 17 00:00:00 2001 From: Xavier Roche Date: Wed, 14 May 2014 17:45:51 +0000 Subject: Added debug logging facility. --- src/htsinthash.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/htsinthash.h') diff --git a/src/htsinthash.h b/src/htsinthash.h index 7150911..f8aee07 100644 --- a/src/htsinthash.h +++ b/src/htsinthash.h @@ -141,6 +141,12 @@ typedef void (*t_inthash_loghandler)(void *arg, inthash_loglevel level, /** Hashtable fatal assertion failure. **/ typedef void (*t_inthash_asserthandler)(void *arg, const char* exp, const char* file, int line); +/** Key printer (debug) **/ +typedef const char* (*t_inthash_printkeyhandler)(void *arg, const char *name); + +/** Value printer (debug) **/ +typedef const char* (*t_inthash_printvaluehandler)(void *arg, void *value); + /** * Value comparison handler (returns non-zero value if strings are equal). **/ @@ -241,6 +247,18 @@ void inthash_set_assert_handler(inthash hashtable, t_inthash_asserthandler fatal, void *arg); +/** + * Set pretty print loggers (debug). Both handlers must return a string + * pointer which shall be valid until the next call. Both key and value + * pointers shall be valid at the same time. + * name: handler called to print the string representation of the name + * value: handler called to print the string representation of the value + **/ +void inthash_set_print_handler(inthash hashtable, + t_inthash_printkeyhandler key, + t_inthash_printvaluehandler value, + void *arg); + /** * Set the hashtable name, for degugging purpose. * name: the hashtable name (ASCII or UTF-8) -- cgit v1.2.3