diff options
| author | Xavier Roche <xroche@users.noreply.github.com> | 2014-05-14 17:45:51 +0000 |
|---|---|---|
| committer | Xavier Roche <xroche@users.noreply.github.com> | 2014-05-14 17:45:51 +0000 |
| commit | 7323230eb3c8fc4818d0cf34974497b3782a7279 (patch) | |
| tree | e4026d34f6009bd06ce6f6bc232863eb63d232ed /src/htsinthash.h | |
| parent | c9f656fdeb0d762bbfc678121bc850a4c0bae7ca (diff) | |
Added debug logging facility.
Diffstat (limited to 'src/htsinthash.h')
| -rw-r--r-- | src/htsinthash.h | 18 |
1 files changed, 18 insertions, 0 deletions
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). **/ @@ -242,6 +248,18 @@ void inthash_set_assert_handler(inthash hashtable, 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) */ |
