2 * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
3 * You may copy, distribute, and use this software as long as this
4 * copyright statement is not removed.
6 /************************************************************************/
8 /* this include sets up some macro functions which can be used while */
9 /* debugging the program, and then left in the code, but turned of by */
10 /* just not defining "DEBUG". This way your production version of */
11 /* the program will not be filled with bunches of debugging junk */
13 /************************************************************************/
15 * $Id: debug.h,v 1.2 2006-07-25 10:07:24 rt Exp $
20 #if DEBUG == 1 /* if default level */
22 #define DEBUG 100 /* use level 100 */
27 #define DEBUG0(val,str)\
30 fprintf(stderr,"%s(%d): %s\n",\
31 __FILE__,__LINE__,str);\
33 #define DEBUG1(val,str,a1)\
38 sprintf(_debugbuf,str,a1);\
39 fprintf(stderr,"%s(%d): %s\n",\
40 __FILE__,__LINE__,_debugbuf);\
44 #define DEBUG2(val,str,a1,a2)\
49 sprintf(_debugbuf,str,a1,a2);\
50 fprintf(stderr,"%s(%d): %s\n",\
51 __FILE__,__LINE__,_debugbuf);\
55 #define DEBUG3(val,str,a1,a2,a3)\
60 sprintf(_debugbuf,str,a1,a2,a3);\
61 fprintf(stderr,"%s(%d): %s\n",\
62 __FILE__,__LINE__,_debugbuf);\
66 #define DEBUG4(val,str,a1,a2,a3,a4)\
71 sprintf(_debugbuf,str,a1,a2,a3,a4);\
72 fprintf(stderr,"%s(%d): %s\n",\
73 __FILE__,__LINE__,_debugbuf);\
77 #define DEBUG5(val,str,a1,a2,a3,a4,a5)\
82 sprintf(_debugbuf,str,a1,a2,a3,a4,a5);\
83 fprintf(stderr,"%s(%d): %s\n",\
84 __FILE__,__LINE__,_debugbuf);\
91 #define DEBUG1(val,s,a1)
92 #define DEBUG2(val,s,a1,a2)
93 #define DEBUG3(val,s,a1,a2,a3)
94 #define DEBUG4(val,s,a1,a2,a3,a4)
95 #define DEBUG5(val,s,a1,a2,a3,a4,a5)