From: Ben Pfaff Date: Thu, 2 Sep 2004 23:53:23 +0000 (+0000) Subject: Reorganize. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af3f05309d7fb5a509946a4e9fd8465e9f782a3e;p=pintos-anon Reorganize. --- diff --git a/src/lib/debug.c b/src/lib/debug.c index 9fbf206..534fc02 100644 --- a/src/lib/debug.c +++ b/src/lib/debug.c @@ -8,6 +8,8 @@ static bool all_enabled; static const char *enabled_classes[MAX_CLASSES]; static size_t enabled_cnt; +static bool class_is_enabled (const char *class); + /* Enables the debug message classes specified in CLASSES. The string CLASSES is modified by and becomes owned by this function. */ @@ -26,22 +28,6 @@ debug_enable (char *classes) } } -/* Checks whether CLASS is enabled. */ -static bool -class_is_enabled (const char *class) -{ - size_t i; - - if (all_enabled) - return true; - - for (i = 0; i < enabled_cnt; i++) - if (!strcmp (enabled_classes[i], class)) - return true; - - return false; -} - /* Prints a debug message along with the source file name, line number, and function name of where it was emitted. CLASS is used to filter out unwanted messages. */ @@ -100,3 +86,20 @@ debug_backtrace (void) printk (" %p", frame[1]); printk (".\n"); } + + +/* Returns true if CLASS is enabled, false otherwise. */ +static bool +class_is_enabled (const char *class) +{ + size_t i; + + if (all_enabled) + return true; + + for (i = 0; i < enabled_cnt; i++) + if (!strcmp (enabled_classes[i], class)) + return true; + + return false; +}