From 24c962c56dc6f6ae4454db6fd52b31b40ec6e16b Mon Sep 17 00:00:00 2001 From: pi-rho Date: Wed, 22 Feb 2012 20:58:53 -0600 Subject: [PATCH] my changes to the utilities --- src/netre.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/netre.h diff --git a/src/netre.h b/src/netre.h new file mode 100644 index 0000000..02db5ac --- /dev/null +++ b/src/netre.h @@ -0,0 +1,23 @@ +#ifndef __NETRE_H__ +#define __NETRE_H__ +#include "config.h" + +#define WHICHOUT(x) (x ? stderr : stdout) + +#ifdef DEBUGSTMTS +/*@notfunction@*/ +# define DDUMPf(fmt, args...) fprintf(stderr, "[@%s:%s():%d] " fmt "\n", __FILE__, __FUNCTION__, __LINE__, ##args) +#else +/*@notfunction@*/ +# define DDUMPf(fmt, args...) +#endif + +#define DDUMP(v) DDUMPf("%s", v) +#define DDUMP_d(v) DDUMPf("%s = %d", #v, v) +#define DDUMP_u(v) DDUMPf("%s = %u", #v, v) +#define DDUMP_x(v) DDUMPf("%s = 0x%x", #v, v) +#define DDUMP_s(v) DDUMPf("%s = %s", #v, v) +#define DDUMP_c(v) DDUMPf("%s = %c", #v, v) +#define DDUMP_p(v) DDUMPf("%s = %p", #v, v) + +#endif /* __NETRE_H__ */