Author: jelmer Date: 2007-10-14 12:52:32 +0000 (Sun, 14 Oct 2007) New Revision: 25626
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25626 Log: Move some debug-specific prototypes to debug.h. Modified: branches/SAMBA_4_0/ branches/SAMBA_4_0/source/lib/util/debug.h branches/SAMBA_4_0/source/lib/util/fault.c branches/SAMBA_4_0/source/lib/util/util.h Changeset: Property changes on: branches/SAMBA_4_0 ___________________________________________________________________ Name: bzr:revision-info ...skipped... Name: bzr:revision-id:v3-trunk0 ...skipped... Modified: branches/SAMBA_4_0/source/lib/util/debug.h =================================================================== --- branches/SAMBA_4_0/source/lib/util/debug.h 2007-10-14 00:25:05 UTC (rev 25625) +++ branches/SAMBA_4_0/source/lib/util/debug.h 2007-10-14 12:52:32 UTC (rev 25626) @@ -68,3 +68,57 @@ /** Possible destinations for the debug log */ 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); + +/** + reopen the log file (usually called because the log file name might have changed) +*/ +_PUBLIC_ void reopen_logs(void); + +/** + * this global variable determines what messages are printed + */ +_PUBLIC_ void debug_schedule_reopen_logs(void); + +/** + control the name of the logfile and whether logging will be to stdout, stderr + or a file +*/ +_PUBLIC_ void setup_logging(const char *prog_name, enum debug_logtype new_logtype); + +/** + return a string constant containing n tabs + no more than 10 tabs are returned +*/ +_PUBLIC_ const char *do_debug_tab(int n); + +/** + log suspicious usage - print comments and backtrace +*/ +_PUBLIC_ void log_suspicious_usage(const char *from, const char *info); + +/** + print suspicious usage - print comments and backtrace +*/ +_PUBLIC_ void print_suspicious_usage(const char* from, const char* info); +_PUBLIC_ uint32_t get_task_id(void); +_PUBLIC_ void log_task_id(void); + +/** + register a set of debug handlers. +*/ +_PUBLIC_ void register_debug_handlers(const char *name, struct debug_ops *ops); + +/** + the backend for debug messages. Note that the DEBUG() macro has already + ensured that the log level has been met before this is called + + @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); Modified: branches/SAMBA_4_0/source/lib/util/fault.c =================================================================== --- branches/SAMBA_4_0/source/lib/util/fault.c 2007-10-14 00:25:05 UTC (rev 25625) +++ branches/SAMBA_4_0/source/lib/util/fault.c 2007-10-14 12:52:32 UTC (rev 25626) @@ -208,7 +208,8 @@ register a fault handler. Should only be called once in the execution of smbd. */ -_PUBLIC_ bool register_fault_handler(const char *name, void (*fault_handler)(int sig)) +_PUBLIC_ bool register_fault_handler(const char *name, + void (*fault_handler)(int sig)) { if (fault_handlers.name != NULL) { /* it's already registered! */ Modified: branches/SAMBA_4_0/source/lib/util/util.h =================================================================== --- branches/SAMBA_4_0/source/lib/util/util.h 2007-10-14 00:25:05 UTC (rev 25625) +++ branches/SAMBA_4_0/source/lib/util/util.h 2007-10-14 12:52:32 UTC (rev 25626) @@ -146,61 +146,6 @@ #define PTR_DIFF(p1,p2) ((ptrdiff_t)(((const char *)(p1)) - (const char *)(p2))) #endif - -/** - * this global variable determines what messages are printed - */ -_PUBLIC_ void debug_schedule_reopen_logs(void); - -/** - 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); - -/** - the backend for debug messages. Note that the DEBUG() macro has already - ensured that the log level has been met before this is called - - @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); - -/** - reopen the log file (usually called because the log file name might have changed) -*/ -_PUBLIC_ void reopen_logs(void); - -/** - control the name of the logfile and whether logging will be to stdout, stderr - or a file -*/ -_PUBLIC_ void setup_logging(const char *prog_name, enum debug_logtype new_logtype); - -/** - return a string constant containing n tabs - no more than 10 tabs are returned -*/ -_PUBLIC_ const char *do_debug_tab(int n); - -/** - log suspicious usage - print comments and backtrace -*/ -_PUBLIC_ void log_suspicious_usage(const char *from, const char *info); - -/** - print suspicious usage - print comments and backtrace -*/ -_PUBLIC_ void print_suspicious_usage(const char* from, const char* info); -_PUBLIC_ uint32_t get_task_id(void); -_PUBLIC_ void log_task_id(void); - -/** - register a set of debug handlers. -*/ -_PUBLIC_ void register_debug_handlers(const char *name, struct debug_ops *ops); - /* The following definitions come from lib/util/fault.c */
