home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1339 / local.h next >
Encoding:
C/C++ Source or Header  |  1990-12-28  |  1.3 KB  |  37 lines

  1. /*
  2.  * sccsid = @(#)  local.h  (v2.1 3/9/90)
  3.  *
  4.  * Local definitions for debugging.
  5.  *
  6.  * This file is included in several source files.
  7.  * The caller must have either set or unset L_DEBUG
  8.  * The macros with DEB end with no ";". The ";" is supplied in the
  9.  * routines. This will result in some spurious stuff but the compiler
  10.  * should ignore empty statements.
  11.  * Unfortunately DI must include the ";". Don't supply one when calling.
  12.  * This is because DI is the first declaration in a routine, and there
  13.  * is no such thing as an empty declaration. If DI is undefined on BSD systems
  14.  * one could do something like "int;", but this is confusing, so I drop it.
  15.  */
  16.  
  17. #ifdef L_DEBUG
  18. extern FILE * prot;
  19. #    define DEB1(p1)                    fprintf(prot,p1,I)
  20. #    define DEB2(p1,p2)                fprintf (prot,p1,I,p2)
  21. #    define DEB3(p1,p2,p3)            fprintf (prot,p1,I,p2,p3)
  22. #    define DEB4(p1,p2,p3,p4)        fprintf (prot,p1,I,p2,p3,p4)
  23. #    define DEB5(p1,p2,p3,p4,p5)        fprintf (prot,p1,I,p2,p3,p4,p5)
  24. #    define DEB6(p1,p2,p3,p4,p5,p6)    fprintf (prot,p1,I,p2,p3,p4,p5,p6)
  25. #    define FLUSH                    fflush (prot)
  26. #    define DI(s)                    static char * I = s;
  27. #else
  28. #    define DEB1(p1)
  29. #    define DEB2(p1,p2)
  30. #    define DEB3(p1,p2,p3)
  31. #    define DEB4(p1,p2,p3,p4)
  32. #    define DEB5(p1,p2,p3,p4,p5)
  33. #    define DEB6(p1,p2,p3,p4,p5,p6)
  34. #    define FLUSH
  35. #    define DI(s)
  36. #endif
  37.