/* some tracer macros that only work when a global variable (tk_debug) ==1 /* need to include STDIO.H for FPRINTF() */ #define PING(level) \ do{ \ if(tk_debug >= level) { \ fprintf(stderr, "PING %s.%d\n",__FILE__,__LINE__); \ } \ } while(0) #define MSG(level, ...) \ do{ \ if(tk_debug >= level) { \ fprintf(stderr, "MSG %s.%d: ",__FILE__,__LINE__); \ fprintf(stderr, __VA_ARGS__ ); \ } \ } while(0) #define DUMP(level, a, fmt) \ do{ \ if(tk_debug == level) { \ fprintf(stderr,"DUMP %s.%d: %s = " fmt "\n",__FILE__,__LINE__, #a,a); \ } \ } while(0)