00001
00002
00003
00004
00005
00006
00007
00008 #define PRN_STDERR 1
00009 #define PRN_SPRINTF 2
00010
00011 extern FILE *dfd;
00012 extern FILE *lfd;
00013 extern int dostats;
00014 extern int slirp_debug;
00015
00016 #define DBG_CALL 0x1
00017 #define DBG_MISC 0x2
00018 #define DBG_ERROR 0x4
00019 #define DEBUG_DEFAULT DBG_CALL|DBG_MISC|DBG_ERROR
00020
00021 #ifdef DEBUG
00022 #define DEBUG_CALL(x) if (slirp_debug & DBG_CALL) { fprintf(dfd, "%s...\n", x); fflush(dfd); }
00023 #define DEBUG_ARG(x, y) if (slirp_debug & DBG_CALL) { fputc(' ', dfd); fprintf(dfd, x, y); fputc('\n', dfd); fflush(dfd); }
00024 #define DEBUG_ARGS(x) if (slirp_debug & DBG_CALL) { fprintf x ; fflush(dfd); }
00025 #define DEBUG_MISC(x) if (slirp_debug & DBG_MISC) { fprintf x ; fflush(dfd); }
00026 #define DEBUG_ERROR(x) if (slirp_debug & DBG_ERROR) {fprintf x ; fflush(dfd); }
00027
00028
00029 #else
00030
00031 #define DEBUG_CALL(x)
00032 #define DEBUG_ARG(x, y)
00033 #define DEBUG_ARGS(x)
00034 #define DEBUG_MISC(x)
00035 #define DEBUG_ERROR(x)
00036
00037 #endif
00038
00039 void debug_init _P((char *, int));