From 7f1288b27f2008215fcd08ee61612c1b52bfb727 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 10 May 2004 14:11:34 +0000 Subject: [PATCH] Added xstrdup() and new logging functions. --- lib/lib.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/lib.h b/lib/lib.h index c06d8f5f..8370a605 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -55,6 +55,7 @@ #define L_FATAL '!' /* die() */ extern char *log_title; /* NULL - print no title, default is log_progname */ +extern int log_switch_nest; /* log_switch() nesting counter, increment to disable automatic switches */ void log_msg(unsigned int cat, const char *msg, ...) __attribute__((format(printf,2,3))); #define log log_msg @@ -63,6 +64,7 @@ void die(byte *, ...) NONRET; void log_init(byte *); void log_file(byte *); void log_fork(void); +void log_switch(void); #ifdef DEBUG void assert_failed(char *assertion, char *file, int line) NONRET; @@ -80,6 +82,9 @@ void assert_failed(void) NONRET; #define DBG(x,y...) do { } while(0) #endif +static inline void log_switch_enable(void) { log_switch_nest++; } +static inline void log_switch_disable(void) { ASSERT(log_switch_nest); log_switch_nest--; } + /* Memory allocation */ #ifdef DEBUG_DMALLOC @@ -106,7 +111,7 @@ void *xrealloc(void *, unsigned); #endif void *xmalloc_zero(unsigned); -byte *stralloc(byte *); +byte *xstrdup(byte *); /* Content-Type pattern matching and filters */ -- 2.39.5