move debug to bti.h
authorGreg Kroah-Hartman <gregkh@suse.de>
Fri, 14 Jan 2011 00:21:48 +0000 (16:21 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 14 Jan 2011 00:21:48 +0000 (16:21 -0800)
This is so that other .c files can call dbg();

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
bti.c
bti.h

diff --git a/bti.c b/bti.c
index 3938e0a..4b31cd5 100644 (file)
--- 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 (file)
--- 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