ceptr
 All Data Structures Files Functions Variables Typedefs Macros Modules Pages
debug.c
Go to the documentation of this file.
1 
5 #include "debug.h"
6 char G_dtype[1000];
7 char *dtypestr(int type) {
8  char *s = &G_dtype[0];
9  if (type & (D_REDUCE+D_REDUCEV)) {sprintf(s,"_REDUCE");s--;};
10  if (type & D_SIGNALS) {sprintf(s,"_SIGNALS");s--;};
11  if (type & D_STX_MATCH) {sprintf(s,"_STX_MATCH");s--;};
12  if (type & D_STX_BUILD) {sprintf(s,"_STX_BUILD");s--;};
13  if (type & D_CLOCK) {sprintf(s,"_CLOCK");s--;};
14  if (type & D_STREAM) {sprintf(s,"_STREAM");s--;};
15  if (type & D_LOCK) {sprintf(s,"_LOCK");s--;};
16  if (type & D_LISTEN) {sprintf(s,"_LISTEN");s--;};
17  if (type & D_TREE) {sprintf(s,"_TREE");s--;};
18  if (type & D_PROTOCOL) {sprintf(s,"_PROTOCOL");s--;};
19  if (type & D_TRANSCODE) {sprintf(s,"_TRANSCODE");s--;};
20  if (type & D_STEP) {sprintf(s,"_STEP");s--;};
21  if (type & D_SOCKET) {sprintf(s,"_SOCKET");s--;};
22  if (type & D_BOOT) {sprintf(s,"_BOOT");s--;};
23  *s=0;
24  return G_dtype;
25 }
26 
27 int G_debug_mask = DEBUG_DEFAULT_MASK;
28 void debug_enable(int type){
29  G_debug_mask |= type;
30 }
31 void debug_disable(int type){
32  G_debug_mask &= ~type;
33 }