aboutsummaryrefslogtreecommitdiff
path: root/lib/libeclat.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libeclat.h')
-rw-r--r--lib/libeclat.h33
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
@@ -15,12 +15,45 @@
along with Eclat. If not, see <http://www.gnu.org/licenses/>. */
#include <stddef.h>
#include <expat.h>
#include "grecs.h"
+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,
const void *key, size_t keylen,
void *digest);
void urlencode(const char *input, size_t len,
char **poutput, size_t *poutlen);

Return to:

Send suggestions and report system problems to the System administrator.