1 /* $Id: DebugPrint.h,v 1.5 1994/05/16 08:34:19 ishisone Rel $ */ 2 3 #ifdef DEBUG 4 extern int debug_all; 5 6 #ifdef DEBUG_VAR 7 int DEBUG_VAR = 0; 8 #else /* DEBUG_VAR */ 9 #ifdef EXT_DEBUG_VAR 10 extern int EXT_DEBUG_VAR; 11 #define DEBUG_VAR EXT_DEBUG_VAR 12 #else /* EXT_DEBUG_VAR */ 13 #define DEBUG_VAR 0 14 #endif /* EXT_DEBUG_VAR */ 15 #endif /* DEBUG_VAR */ 16 17 #define DEBUG_CONDITION (debug_all || DEBUG_VAR) 18 #define DDEBUG_CONDITION(l) (debug_all >= (l) || DEBUG_VAR >= (l)) 19 #define DPRINT(args) { if (DEBUG_CONDITION) printf args; } 20 #define DDPRINT(level, args) \ 21 { if (DDEBUG_CONDITION(level)) printf args; } 22 #define TRACE(args) DDPRINT(10, args) 23 24 #else /* !DEBUG */ 25 26 #define DEBUG_CONDITION 0 27 #define DDEBUG_CONDITION(l) 0 28 #define DPRINT(args) 29 #define DDPRINT(level, args) 30 #define TRACE(args) 31 32 #endif 33