From 2c4391e95002404fb2e1d09f97541c1ece1da46f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 11 Oct 2008 20:44:19 +0200 Subject: Provide the same set of helper functions for DEBUG in Samba 3 and Samba 4, even though the macros are still different. This makes it possible to use object code compiled with one DEBUG() macro from the other sourceX directory. --- source4/lib/util/debug.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source4/lib/util/debug.h') diff --git a/source4/lib/util/debug.h b/source4/lib/util/debug.h index 605628174a..8f4fa2a8fc 100644 --- a/source4/lib/util/debug.h +++ b/source4/lib/util/debug.h @@ -39,6 +39,7 @@ struct debug_ops { void (*log_task_id)(int fd); }; +#define DEBUGLEVEL *debug_level extern int DEBUGLEVEL; #define debug_ctx() (_debug_ctx?_debug_ctx:(_debug_ctx=talloc_new(NULL))) @@ -48,9 +49,9 @@ extern int DEBUGLEVEL; if (DEBUGLVL(level)) { \ void* _debug_ctx=NULL; \ if (header) { \ - do_debug_header(level, __location__, __FUNCTION__); \ + dbghdr(level, __location__, __FUNCTION__); \ } \ - do_debug body; \ + dbgtext body; \ talloc_free(_debug_ctx); \ } \ } while (0) @@ -77,7 +78,7 @@ enum debug_logtype {DEBUG_STDOUT = 0, DEBUG_FILE = 1, DEBUG_STDERR = 2}; the backend for debug messages. Note that the DEBUG() macro has already ensured that the log level has been met before this is called */ -_PUBLIC_ void do_debug_header(int level, const char *location, const char *func); +_PUBLIC_ void dbghdr(int level, const char *location, const char *func); /** reopen the log file (usually called because the log file name might have changed) @@ -125,4 +126,4 @@ _PUBLIC_ void register_debug_handlers(const char *name, struct debug_ops *ops); @note You should never have to call this function directly. Call the DEBUG() macro instead. */ -_PUBLIC_ void do_debug(const char *format, ...) PRINTF_ATTRIBUTE(1,2); +_PUBLIC_ void dbgtext(const char *format, ...) PRINTF_ATTRIBUTE(1,2); -- cgit