1 #ifndef DEBUG_H 2 #define DEBUG_H 3 4 # include <stdio.h> 5 6 #ifdef DEBUG 7 # define PSTDERR(fmt, args...) do { dprintf(2,fmt, ## args); } while(0) 8 # define PDEBUG(fmt, args...) PSTDERR("DEBUG:pid[%d]:" fmt, getpid(), ## args) 9 # define DEBUGDECL(args...) args 10 # define DUMP_PROXY_CHAIN(A, B) dump_proxy_chain(A, B) 11 #else 12 # define PDEBUG(fmt, args...) do {} while (0) 13 # define DEBUGDECL(args...) 14 # define DUMP_PROXY_CHAIN(args...) do {} while (0) 15 #endif 16 17 # define PFUNC() do { PDEBUG("%s()\n", __FUNCTION__); } while(0) 18 19 #include "core.h" 20 void dump_proxy_chain(proxy_data *pchain, unsigned int count); 21 22 23 #endif 24 25