From e45e53c72f65e6e173ae1d624dd683fe0deefc61 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 13 Jan 2011 16:21:48 -0800 Subject: [PATCH 1/1] move debug to bti.h This is so that other .c files can call dbg(); Signed-off-by: Greg Kroah-Hartman --- bti.c | 2 +- bti.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bti.c b/bti.c index 3938e0a..4b31cd5 100644 --- a/bti.c +++ b/bti.c @@ -52,7 +52,7 @@ } while (0) -static int debug; +int debug; static void display_help(void) { diff --git a/bti.h b/bti.h index cc93963..13cdbda 100644 --- a/bti.h +++ b/bti.h @@ -82,7 +82,16 @@ extern const char twitter_host[]; extern const char identica_host[]; extern const char twitter_name[]; extern const char identica_name[]; +extern int debug; extern void bti_parse_configfile(struct session *session); +#define dbg(format, arg...) \ + do { \ + if (debug) \ + fprintf(stdout, "bti: %s: " format , __func__ , \ + ## arg); \ + } while (0) + + #endif -- 2.39.5