File: debug.c

package info (click to toggle)
cgiwrap 3.5-3
  • links: PTS
  • area: non-free
  • in suites: hamm
  • size: 356 kB
  • ctags: 115
  • sloc: sh: 3,954; ansic: 1,036; perl: 104; makefile: 86
file content (56 lines) | stat: -rw-r--r-- 902 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
static char *rcsid="$Id: debug.c,v 1.6 1996/05/31 16:34:03 nneul Exp $";

/**
 **  File: debug.c
 **  Purpose: Debugging output routines
 **/ 

#include "cgiwrap.h"	/* Headers for all CGIwrap source files */

/*
 * Global flag to turn debugging output on/off
 */
int CONF_DEBUG;


/*
 * Print out a debugging message if CONF_DEBUG is true
 */
void DEBUG_Msg (char *msg)
{
	if (CONF_DEBUG)
	{
		printf("%s\n", NullCheck(msg));
		fflush(stdout);
	}
}

void DEBUG_Str (char *msg, char *var)
{
	if (CONF_DEBUG)
	{
		printf("%s '%s'\n", NullCheck(msg), NullCheck(var) );
		fflush(stdout);
	}
}

void DEBUG_StrStr (char *msg, char *var, char *var2)
{
	if (CONF_DEBUG)
	{
		printf("%s '%s'-'%s'\n", NullCheck(msg), 
		    NullCheck(var), NullCheck(var2) );
		fflush(stdout);
	}
}

void DEBUG_Int (char *msg, int var)
{
	if (CONF_DEBUG)
	{
		printf("%s '%d'\n", NullCheck(msg), var );
		fflush(stdout);
	}
}