diff options
Diffstat (limited to 'lib/libeclat.h')
-rw-r--r-- | lib/libeclat.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/libeclat.h b/lib/libeclat.h index 670c51b..5f37cc9 100644 --- a/lib/libeclat.h +++ b/lib/libeclat.h @@ -20,2 +20,35 @@ +extern const char *program_name; + +struct debug_category { + const char *name; + size_t length; + int level; +}; + +extern struct debug_category debug_category[]; +#define LIBECLAT_DBG_MAX 64 + +#define debug_level(cat) ((cat >= 0 && cat < LIBECLAT_DBG_MAX) ? \ + debug_category[cat].level : 0) +#define debug(cat, lev, s) \ + do { \ + if (debug_level(cat) >= (lev)) \ + debug_printf s; \ + } while(0) + +void set_program_name(const char *arg); + +void die(int status, const char *fmt, ...); +void vdiag(grecs_locus_t const *locus, const char *qual, const char *fmt, + va_list ap); +void diag(grecs_locus_t const *locus, const char *qual, const char *fmt, ...); +void err(const char *fmt, ...); +void warn(const char *fmt, ...); +void debug_printf(const char *fmt, ...); + +int parse_debug_level(const char *arg); +int debug_register(char *name); + + void hmac_sha1(const void *text, size_t textlen, |