root / slirp / debug.h @ eae6ce52
History | View | Annotate | Download (1013 Bytes)
1 | f0cbd3ec | bellard | /*
|
---|---|---|---|
2 | f0cbd3ec | bellard | * Copyright (c) 1995 Danny Gasparovski.
|
3 | 5fafdf24 | ths | *
|
4 | 5fafdf24 | ths | * Please read the file COPYRIGHT for the
|
5 | f0cbd3ec | bellard | * terms and conditions of the copyright.
|
6 | f0cbd3ec | bellard | */
|
7 | f0cbd3ec | bellard | |
8 | f0cbd3ec | bellard | #define PRN_STDERR 1 |
9 | f0cbd3ec | bellard | #define PRN_SPRINTF 2 |
10 | f0cbd3ec | bellard | |
11 | f0cbd3ec | bellard | extern FILE *dfd;
|
12 | f0cbd3ec | bellard | extern FILE *lfd;
|
13 | f0cbd3ec | bellard | extern int dostats; |
14 | f0cbd3ec | bellard | extern int slirp_debug; |
15 | f0cbd3ec | bellard | |
16 | f0cbd3ec | bellard | #define DBG_CALL 0x1 |
17 | f0cbd3ec | bellard | #define DBG_MISC 0x2 |
18 | f0cbd3ec | bellard | #define DBG_ERROR 0x4 |
19 | f0cbd3ec | bellard | #define DEBUG_DEFAULT DBG_CALL|DBG_MISC|DBG_ERROR
|
20 | f0cbd3ec | bellard | |
21 | f0cbd3ec | bellard | #ifdef DEBUG
|
22 | f0cbd3ec | bellard | #define DEBUG_CALL(x) if (slirp_debug & DBG_CALL) { fprintf(dfd, "%s...\n", x); fflush(dfd); } |
23 | f0cbd3ec | bellard | #define DEBUG_ARG(x, y) if (slirp_debug & DBG_CALL) { fputc(' ', dfd); fprintf(dfd, x, y); fputc('\n', dfd); fflush(dfd); } |
24 | f0cbd3ec | bellard | #define DEBUG_ARGS(x) if (slirp_debug & DBG_CALL) { fprintf x ; fflush(dfd); } |
25 | f0cbd3ec | bellard | #define DEBUG_MISC(x) if (slirp_debug & DBG_MISC) { fprintf x ; fflush(dfd); } |
26 | f0cbd3ec | bellard | #define DEBUG_ERROR(x) if (slirp_debug & DBG_ERROR) {fprintf x ; fflush(dfd); } |
27 | f0cbd3ec | bellard | |
28 | f0cbd3ec | bellard | |
29 | f0cbd3ec | bellard | #else
|
30 | f0cbd3ec | bellard | |
31 | f0cbd3ec | bellard | #define DEBUG_CALL(x)
|
32 | f0cbd3ec | bellard | #define DEBUG_ARG(x, y)
|
33 | f0cbd3ec | bellard | #define DEBUG_ARGS(x)
|
34 | f0cbd3ec | bellard | #define DEBUG_MISC(x)
|
35 | f0cbd3ec | bellard | #define DEBUG_ERROR(x)
|
36 | f0cbd3ec | bellard | |
37 | f0cbd3ec | bellard | #endif
|
38 | f0cbd3ec | bellard | |
39 | f0cbd3ec | bellard | void debug_init _P((char *, int)); |