1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
2 | /* $Id: debug.h,v 1.4 1997-06-05 13:53:40 schmidt Exp $ */ |
---|
3 | |
---|
4 | /* |
---|
5 | $Log: not supported by cvs2svn $ |
---|
6 | Revision 1.3 1997/05/14 15:57:33 schmidt |
---|
7 | o undefines DEBUGOUTPUT if #define NDEBUG is set now |
---|
8 | |
---|
9 | Revision 1.2 1997/04/15 11:01:49 schmidt |
---|
10 | macro DEBOUTLN sightly simplified |
---|
11 | |
---|
12 | Revision 1.1 1997/03/26 17:14:06 schmidt |
---|
13 | Initial revision |
---|
14 | |
---|
15 | */ |
---|
16 | |
---|
17 | /* It should be possible to include this file multiple times for different */ |
---|
18 | /* settings of DEBUGOUTPUT */ |
---|
19 | |
---|
20 | #undef DEBINCLEVEL |
---|
21 | #undef DEBDECLEVEL |
---|
22 | #undef DEBOUTSL |
---|
23 | #undef DEBOUT |
---|
24 | #undef DEBOUTENDL |
---|
25 | #undef DEBOUTLN |
---|
26 | |
---|
27 | #ifdef DEBUGOUTPUT |
---|
28 | #include <iostream.h> |
---|
29 | void deb_inc_level(); |
---|
30 | void deb_dec_level(); |
---|
31 | extern char * deb_level_msg; |
---|
32 | #define DEBINCLEVEL(stream, msg) \ |
---|
33 | (stream << deb_level_msg << "entering << " << msg << " >>" << endl, deb_inc_level()) |
---|
34 | #define DEBDECLEVEL(stream, msg) \ |
---|
35 | (deb_dec_level(), stream << deb_level_msg << "leaving << " << msg << " >>" << endl) |
---|
36 | #define DEBOUTSL(stream) \ |
---|
37 | (stream << deb_level_msg, stream.flush()) |
---|
38 | #define DEBOUT(stream, objects) \ |
---|
39 | (stream << objects, stream.flush()) |
---|
40 | #define DEBOUTENDL(stream) \ |
---|
41 | (stream << endl) |
---|
42 | #define DEBOUTLN(stream, objects) \ |
---|
43 | (stream << deb_level_msg << objects << endl) |
---|
44 | #else /* DEBUGOUTPUT */ |
---|
45 | #define DEBINCLEVEL(stream, msg) |
---|
46 | #define DEBDECLEVEL(stream, msg) |
---|
47 | #define DEBOUTSL(stream) |
---|
48 | #define DEBOUT(stream, objects) |
---|
49 | #define DEBOUTENDL(stream) |
---|
50 | #define DEBOUTLN(stream, objects) |
---|
51 | #endif /* DEBUGOUTPUT */ |
---|