diff options
-rw-r--r-- | metastore.c | 8 | ||||
-rw-r--r-- | utils.c | 9 | ||||
-rw-r--r-- | utils.h | 4 |
3 files changed, 14 insertions, 7 deletions
diff --git a/metastore.c b/metastore.c index 2db4c31..d831aa7 100644 --- a/metastore.c +++ b/metastore.c @@ -249,10 +249,10 @@ main(int argc, char **argv, char **envp) switch (c) { case 0: if (!strcmp("verbose", long_options[option_index].name)) { - verbosity++; + adjust_verbosity(1); } else if (!strcmp("quiet", long_options[option_index].name)) { - verbosity--; + adjust_verbosity(-1); } else if (!strcmp("mtime", long_options[option_index].name)) { do_mtime = 1; @@ -278,10 +278,10 @@ main(int argc, char **argv, char **envp) i++; break; case 'v': - verbosity++; + adjust_verbosity(1); break; case 'q': - verbosity--; + adjust_verbosity(-1); break; case 'm': do_mtime = 1; @@ -28,7 +28,14 @@ #include "utils.h" /* Controls the verbosity level for msg() */ -int verbosity = 0; +static int verbosity = 0; + +/* Adjusts the verbosity level for msg() */ +void +adjust_verbosity(int adj) +{ + verbosity += adj; +} /* * Prints messages to console according to the current verbosity @@ -21,8 +21,8 @@ /* For uint64_t */ #include <stdint.h> -/* Controls the verbosity level for msg() */ -extern int verbosity; +/* Adjusts the verbosity level for msg() */ +void adjust_verbosity(int adj); /* Verbosity levels using stdout */ #define MSG_NORMAL 0 |