Project Homepage Sourceforge Page CVS Repository Freshmeat.net Page Download project Author's Homepage

debug.h File Reference


Detailed Description

run-free debug macros

These macros are here for convenience. Mostly I use this kind of stuff for light debug work here and there. Please feel free to steal what you need and use it as your own -parasyte.

Definition in file debug.h.

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Debugging statments

These macros print statements to the command line when run-free is compiled with the --enable-debug=yes directive from configure

#define dprint(string)   dprint_s1(string)
 print a string in debug mode -a convenience function

#define dprint_s1(string)   if(DEBUG_MODE) g_print(""DEBUG_PREMSG" "DEBUG_SUBMSG"(%s)\n", string)
 single string printing

#define dprint_s2(string1, string2)   if(DEBUG_MODE) g_print(""DEBUG_PREMSG" "DEBUG_SUBMSG"(%s:%s)\n", string1, string2)
 double string printing

#define dprint_f1(format, data)   if(DEBUG_MODE) g_print(""DEBUG_PREMSG" "DEBUG_SUBMSG"("format")\n", data)
 single format debugging from gprint

#define dprint_f2(format1, format2, data1, data2)   if(DEBUG_MODE) g_print(""DEBUG_PREMSG" "DEBUG_SUBMSG"("format1":"format2")\n", data1, data2)
 double format debugging from gprint


Defines

#define DEBUG_MODE   0
 compile time option

#define DEBUG_PREMSG   PACKAGE
 The package name.

#define DEBUG_SUBMSG   "DEBUG"
 a submessage


Define Documentation

#define DEBUG_MODE   0
 

compile time option

run-free DEBUGING STATEMENTS.

These would be called in the following ways:
dprint("this is a string");
dprint_s1("this is also a string");
dprint_s2("foo", "bar");
dprint_f1("%s", "thing");
dprint_f1("%d", 1);
dprint_f2("%s", "%d", "stuff", 69);
dprint_f2("%s", "%x", "a hex number", 255);

This would be the output (assuming PACKAGE is defined as "run-free"):
run-free DEBUG(this is a string)
run-free DEBUG(this is also a string)
run-free DEBUG(foo:bar)
run-free DEBUG(thing)
run-free DEBUG(1)
run-free DEBUG(stuff:69)
run-free DEBUG(a hex number:ff)

Definition at line 60 of file debug.h.

Referenced by main().

#define DEBUG_PREMSG   PACKAGE
 

The package name.

Definition at line 64 of file debug.h.

#define DEBUG_SUBMSG   "DEBUG"
 

a submessage

Definition at line 67 of file debug.h.

#define dprint string   )     dprint_s1(string)
 

print a string in debug mode -a convenience function

Definition at line 75 of file debug.h.

Referenced by main(), and readHistory().

#define dprint_f1 format,
data   )     if(DEBUG_MODE) g_print(""DEBUG_PREMSG" "DEBUG_SUBMSG"("format")\n", data)
 

single format debugging from gprint

Definition at line 81 of file debug.h.

#define dprint_f2 format1,
format2,
data1,
data2   )     if(DEBUG_MODE) g_print(""DEBUG_PREMSG" "DEBUG_SUBMSG"("format1":"format2")\n", data1, data2)
 

double format debugging from gprint

Definition at line 83 of file debug.h.

#define dprint_s1 string   )     if(DEBUG_MODE) g_print(""DEBUG_PREMSG" "DEBUG_SUBMSG"(%s)\n", string)
 

single string printing

Definition at line 77 of file debug.h.

#define dprint_s2 string1,
string2   )     if(DEBUG_MODE) g_print(""DEBUG_PREMSG" "DEBUG_SUBMSG"(%s:%s)\n", string1, string2)
 

double string printing

Definition at line 79 of file debug.h.

Referenced by main().


Generated on Thu Mar 18 07:26:18 2004 for run-free by doxygen 1.3.5