File: ec_debug.h

package info (click to toggle)
ettercap 1%3A0.8.4-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,272 kB
  • sloc: ansic: 58,389; yacc: 313; lex: 204; makefile: 112; sh: 84; xml: 69
file content (31 lines) | stat: -rw-r--r-- 788 bytes parent folder | download | duplicates (8)
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
#if defined(DEBUG) && !defined(ETTERCAP_DEBUG_H)
#define ETTERCAP_DEBUG_H

EC_API_EXTERN void debug_init(void);
EC_API_EXTERN void debug_msg(const char *message, ...);

EC_API_EXTERN FILE *debug_file;

#define DEBUG_INIT() debug_init()
#define DEBUG_MSG(x, ...) do {                                 \
   if (debug_file == NULL) {                                   \
      fprintf(stderr, "DEBUG: "x"\n", ## __VA_ARGS__ );        \
   } else                                                      \
      debug_msg(x, ## __VA_ARGS__ );                           \
} while(0)

#endif /* EC_DEBUG_H */

/* 
 * if DEBUG is not defined we expand the macros to null instructions...
 */

#ifndef DEBUG
   #define DEBUG_INIT()
   #define DEBUG_MSG(x, ...)
#endif

/* EOF */

// vim:ts=3:expandtab