File: debug.h

package info (click to toggle)
similarity-tester 2.77-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 572 kB
  • ctags: 512
  • sloc: ansic: 3,197; lex: 1,562; makefile: 301
file content (35 lines) | stat: -rw-r--r-- 1,025 bytes parent folder | download
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
/*	This file is part of the debugging module DEBUG.
	Written by Dick Grune, Vrije Universiteit, Amsterdam.
	$Id: debug.h,v 1.7 2013-05-12 09:58:34 Gebruiker Exp $
*/

#ifndef	_DEBUG_H_
#define _DEBUG_H_

/****
The module DEBUG defines one routine,

	extern void wr_info(const char *s, int b, int v);

which, when compiled with a -DDEBUG option, writes the string s, a space
character, the value v in base b, and a newline to standard error output (file
descriptor 2), without interfering with other program activities.

The following values for b are accepted:
    b = 0:      the string s only
    b = 8:	octal
    b = 16:	hex
    b = 128:	char
    otherwise:	decimal

This allows debugging info to be obtained in the presence of sudden crashes
and other nefarious program activity.

Compiled without the -DDEBUG option wr_info does nothing. This allows easy
switching off of the debugging feature by recompiling debug.c.
****/

/* Public entries */
extern void wr_info(const char *s, int b, int v);

#endif	/* _DEBUG_H_ */