2004-04-22 04:10:48 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1995 Danny Gasparovski.
|
2007-09-17 01:08:06 +04:00
|
|
|
*
|
|
|
|
* Please read the file COPYRIGHT for the
|
2004-04-22 04:10:48 +04:00
|
|
|
* terms and conditions of the copyright.
|
|
|
|
*/
|
|
|
|
|
2018-11-22 01:06:36 +03:00
|
|
|
#ifndef DEBUG_H_
|
|
|
|
#define DEBUG_H_
|
2004-04-22 04:10:48 +04:00
|
|
|
|
2019-01-17 14:43:38 +03:00
|
|
|
#define DBG_CALL (1 << 0)
|
|
|
|
#define DBG_MISC (1 << 1)
|
|
|
|
#define DBG_ERROR (1 << 2)
|
|
|
|
#define DBG_TFTP (1 << 3)
|
2004-04-22 04:10:48 +04:00
|
|
|
|
2009-06-24 16:42:29 +04:00
|
|
|
extern int slirp_debug;
|
|
|
|
|
2018-11-14 15:36:31 +03:00
|
|
|
#define DEBUG_CALL(fmt, ...) do { \
|
2018-11-22 01:40:34 +03:00
|
|
|
if (G_UNLIKELY(slirp_debug & DBG_CALL)) { \
|
2018-11-22 01:06:41 +03:00
|
|
|
g_debug(fmt "...", ##__VA_ARGS__); \
|
2018-11-14 15:36:31 +03:00
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define DEBUG_ARG(fmt, ...) do { \
|
2018-11-22 01:40:34 +03:00
|
|
|
if (G_UNLIKELY(slirp_debug & DBG_CALL)) { \
|
2018-11-22 01:06:41 +03:00
|
|
|
g_debug(" " fmt, ##__VA_ARGS__); \
|
2018-11-14 15:36:31 +03:00
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define DEBUG_MISC(fmt, ...) do { \
|
2018-11-22 01:40:34 +03:00
|
|
|
if (G_UNLIKELY(slirp_debug & DBG_MISC)) { \
|
2018-11-22 01:06:41 +03:00
|
|
|
g_debug(fmt, ##__VA_ARGS__); \
|
2018-11-14 15:36:31 +03:00
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define DEBUG_ERROR(fmt, ...) do { \
|
2018-11-22 01:40:34 +03:00
|
|
|
if (G_UNLIKELY(slirp_debug & DBG_ERROR)) { \
|
2018-11-22 01:06:41 +03:00
|
|
|
g_debug(fmt, ##__VA_ARGS__); \
|
2018-11-14 15:36:31 +03:00
|
|
|
} \
|
|
|
|
} while (0)
|
2004-04-22 04:10:48 +04:00
|
|
|
|
2019-01-17 14:43:38 +03:00
|
|
|
#define DEBUG_TFTP(fmt, ...) do { \
|
|
|
|
if (G_UNLIKELY(slirp_debug & DBG_TFTP)) { \
|
|
|
|
g_debug(fmt, ##__VA_ARGS__); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
2018-11-22 01:06:36 +03:00
|
|
|
#endif /* DEBUG_H_ */
|