diff src/main.c @ 507:135570a8bd96

Move debug macros from main.h to new debug.h. Make debug_level static to debug.c and add utility functions to manipulate it. Add #include "debug.h" where needed.
author zas_
date Thu, 24 Apr 2008 08:53:39 +0000
parents fc9c8a3e1a8b
children b78a91d0779e
line wrap: on
line diff
--- a/src/main.c	Thu Apr 24 00:15:03 2008 +0000
+++ b/src/main.c	Thu Apr 24 08:53:39 2008 +0000
@@ -16,6 +16,7 @@
 #include "cache.h"
 #include "collect.h"
 #include "collect-io.h"
+#include "debug.h"
 #include "dnd.h"
 #include "editors.h"
 #include "filelist.h"
@@ -745,7 +746,7 @@
 			}
 
 		if (blank || cmd_list || path) g_string_append(command, " --blank");
-		if (debug) g_string_append(command, " --debug");
+		if (get_debug_level()) g_string_append(command, " --debug");
 
 		g_string_append(command, " &");
 		system(command->str);
@@ -1151,18 +1152,18 @@
 
 				/* we now increment the debug state for verbosity */
 				if (cmd_line_len == len)
-					debug++;
+					debug_level_add(1);
 				else if (cmd_line[len] == '=' && g_ascii_isdigit(cmd_line[len+1]))
 					{
 					gint n = atoi(cmd_line + len + 1);
 					if (n < 0) n = 1;
-					debug += n;
+					debug_level_add(n);
 					}
 				}
 			}
 		}
 
-	DEBUG_1("debugging output enabled (level %d)", debug);
+	DEBUG_1("debugging output enabled (level %d)", get_debug_level());
 #endif
 }