diff options
-rw-r--r-- | conf.h | 18 | ||||
-rw-r--r-- | debug.h | 30 |
2 files changed, 30 insertions, 18 deletions
@@ -1,10 +1,6 @@ #ifndef conf_h_INCLUDED #define conf_h_INCLUDED -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - #ifdef LOCAL #define HOST "0.0.0.0" #define PORT "6971" @@ -17,20 +13,6 @@ #define SOCKETGROUP "apionet" #endif -#ifdef DEBUG - #define DP(x) puts(x) - #define DPn(name,x,len) \ - do { \ - char *__xxx = strndup(x,len); \ - printf(name " [%s]\n",__xxx); \ - free(__xxx); \ - } while (0) - #define DPf(...) fprintf(stderr,__VA_ARGS__) -#else - #define DP(x) - #define DPn(n,x,l) - #define DPf(...) -#endif #define NICK "Bee" #define USERNAME "apiobot" @@ -0,0 +1,30 @@ +#ifndef debug_h_INCLUDED +#define debug_h_INCLUDED + + +#ifdef DEBUG + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define DP(x) puts(x) +#define DPn(name,x,len) \ + do { \ + char *__xxx = strndup(x,len); \ + printf(name " [%s]\n",__xxx); \ + free(__xxx); \ + } while (0) +#define DPf(...) fprintf(stderr,__VA_ARGS__) + + +#else + +#define DP(x) +#define DPn(n,x,l) +#define DPf(...) + +#endif + +#endif // debug_h_INCLUDED + |