2004-04-22 00:10:48 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1995 Danny Gasparovski.
|
2007-09-16 21:08:06 +00:00
|
|
|
*
|
|
|
|
* Please read the file COPYRIGHT for the
|
2004-04-22 00:10:48 +00:00
|
|
|
* terms and conditions of the copyright.
|
|
|
|
*/
|
|
|
|
|
2018-11-21 22:06:36 +00:00
|
|
|
#ifndef DEBUG_H_
|
|
|
|
#define DEBUG_H_
|
2004-04-22 00:10:48 +00:00
|
|
|
|
|
|
|
#define DBG_CALL 0x1
|
|
|
|
#define DBG_MISC 0x2
|
|
|
|
#define DBG_ERROR 0x4
|
|
|
|
|
2009-06-24 12:42:29 +00:00
|
|
|
#define dfd stderr
|
|
|
|
|
|
|
|
extern int slirp_debug;
|
|
|
|
|
2018-11-14 12:36:31 +00:00
|
|
|
#define DEBUG_CALL(fmt, ...) do { \
|
|
|
|
if (slirp_debug & DBG_CALL) { \
|
|
|
|
fprintf(dfd, fmt, ##__VA_ARGS__); \
|
|
|
|
fprintf(dfd, "...\n"); \
|
|
|
|
fflush(dfd); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define DEBUG_ARG(fmt, ...) do { \
|
|
|
|
if (slirp_debug & DBG_CALL) { \
|
|
|
|
fputc(' ', dfd); \
|
|
|
|
fprintf(dfd, fmt, ##__VA_ARGS__); \
|
|
|
|
fputc('\n', dfd); \
|
|
|
|
fflush(dfd); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define DEBUG_MISC(fmt, ...) do { \
|
|
|
|
if (slirp_debug & DBG_MISC) { \
|
|
|
|
fprintf(dfd, fmt, ##__VA_ARGS__); \
|
|
|
|
fflush(dfd); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define DEBUG_ERROR(fmt, ...) do { \
|
|
|
|
if (slirp_debug & DBG_ERROR) { \
|
|
|
|
fprintf(dfd, fmt, ##__VA_ARGS__); \
|
|
|
|
fflush(dfd); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
2004-04-22 00:10:48 +00:00
|
|
|
|
2018-11-21 22:06:36 +00:00
|
|
|
#endif /* DEBUG_H_ */
|