--- np2/x11/trace.h 2003/10/16 17:59:41 1.1 +++ np2/x11/trace.h 2004/03/02 16:33:27 1.4 @@ -1,29 +1,38 @@ +#ifndef NP2_X11_TRACE_H__ +#define NP2_X11_TRACE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +extern int trace_flag; #ifndef TRACE #define TRACEINIT() #define TRACETERM() #define TRACEOUT(a) -#define VERBOSE(a) - -#else - -#ifdef __cplusplus -extern "C" { +#ifndef VERBOSE +#define VERBOSE(s) #endif +#else /* TRACE */ + void trace_init(void); void trace_term(void); void trace_fmt(const char *str, ...); -#define TRACEINIT() trace_init() -#define TRACETERM() trace_term() +#define TRACEINIT() trace_init() +#define TRACETERM() trace_term() #define TRACEOUT(arg) trace_fmt arg -#define VERBOSE(arg) trace_fmt arg +#ifndef VERBOSE +#define VERBOSE(arg) if (trace_flag) trace_fmt arg +#endif + +#endif /* !TRACE */ #ifdef __cplusplus }; #endif -#endif - +#endif /* NP2_X11_TRACE_H__ */