changeset 2823:cd23279122ed

[gaim-migrate @ 2836] remove DEBUG committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 01 Dec 2001 01:48:26 +0000
parents 744df95bf123
children 2c39e70dd07c
files src/aim.c src/gaim.h src/module.c src/prefs.c src/util.c
diffstat 5 files changed, 17 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/aim.c	Sat Dec 01 01:13:12 2001 +0000
+++ b/src/aim.c	Sat Dec 01 01:48:26 2001 +0000
@@ -80,6 +80,7 @@
 int opt_away = 0;
 char *opt_away_arg = NULL;
 char *opt_rcfile_arg = NULL;
+int opt_debug = 0;
 
 void BuddyTickerCreateWindow(void);
 
@@ -540,6 +541,8 @@
 		 "Use account NAME", "NAME"},
 		{"file", 'f', POPT_ARG_STRING, &opt_rcfile_arg, 'f',
 		 "Use FILE as config", "FILE"},
+		{"debug", 'd', POPT_ARG_NONE, &opt_debug, 'd',
+		 "Print debugging messages to stdout", NULL},
 		{0, 0, 0, 0, 0, 0, 0}
 	};
 #endif /* USE_GNOME */
@@ -550,11 +553,15 @@
 		/*{"login", optional_argument, NULL, 'l'}, */
 		{"user", required_argument, NULL, 'u'},
 		{"file", required_argument, NULL, 'f'},
+		{"debug", no_argument, NULL, 'd'},
 		{"version", no_argument, NULL, 'v'},
 		{0, 0, 0, 0}
 	};
 #endif
 
+#ifdef DEBUG
+	opt_debug = 1;
+#endif
 
 #ifdef ENABLE_NLS
 	bindtextdomain(PACKAGE, LOCALEDIR);
@@ -660,7 +667,7 @@
 #else
 	opterr = 1;
 #endif
-	while ((opt = getopt_long(argc, argv, "ahu:f:v", long_options, NULL)) != -1) {
+	while ((opt = getopt_long(argc, argv, "adhu:f:v", long_options, NULL)) != -1) {
 		switch (opt) {
 		case 'u':	/* set user */
 			opt_user = 1;
@@ -669,6 +676,9 @@
 		case 'a':	/* account editor */
 			opt_acct = 1;
 			break;
+		case 'd':	/* debug */
+			opt_debug = 1;
+			break;
 		case 'f':
 			opt_rcfile_arg = g_strdup(optarg);
 			break;
--- a/src/gaim.h	Sat Dec 01 01:13:12 2001 +0000
+++ b/src/gaim.h	Sat Dec 01 01:48:26 2001 +0000
@@ -189,6 +189,7 @@
 extern int opt_away;
 extern char *opt_away_arg;
 extern char *opt_rcfile_arg;
+extern int opt_debug;
 
 extern guint misc_options;
 #define OPT_MISC_DEBUG			0x00000001
--- a/src/module.c	Sat Dec 01 01:13:12 2001 +0000
+++ b/src/module.c	Sat Dec 01 01:48:26 2001 +0000
@@ -369,10 +369,9 @@
 
 static void debug_event(enum gaim_event event, void *arg1, void *arg2, void *arg3, void *arg4)
 {
-#ifndef DEBUG
-	if (!(misc_options & OPT_MISC_DEBUG))
+	if (!opt_debug && !(misc_options & OPT_MISC_DEBUG))
 		return;
-#endif
+
 	switch (event) {
 		case event_quit:
 			debug_printf("%s\n", event_name(event));
--- a/src/prefs.c	Sat Dec 01 01:13:12 2001 +0000
+++ b/src/prefs.c	Sat Dec 01 01:48:26 2001 +0000
@@ -2516,9 +2516,8 @@
 		if (scroll)
 			gtk_adjustment_set_value(adj, adj->upper - adj->lower - adj->page_size);
 	}
-#ifdef DEBUG
-	g_print("%s", s);
-#endif
+	if (opt_debug)
+		g_print("%s", s);
 	g_free(s);
 }
 
--- a/src/util.c	Sat Dec 01 01:13:12 2001 +0000
+++ b/src/util.c	Sat Dec 01 01:48:26 2001 +0000
@@ -771,6 +771,7 @@
 		       "                      account(s) to use)\n"
 		       "  -u, --user=NAME     use account NAME\n"
 		       "  -f, --file=FILE     use FILE as config\n"
+		       "  -d, --debug         print debugging messages to stdout\n"
 		       "  -v, --version       display version information window\n"
 		       "  -h, --help          display this help and exit\n", name);
 		break;