summaryrefslogtreecommitdiff
path: root/src/vtcol.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/vtcol.rs')
-rw-r--r--src/vtcol.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/vtcol.rs b/src/vtcol.rs
index a82e5bb..993653b 100644
--- a/src/vtcol.rs
+++ b/src/vtcol.rs
@@ -1,15 +1,16 @@
-extern crate libc;
-extern crate getopts;
-extern crate core;
+use std::sync::Mutex;
+use lazy_static::lazy_static;
type Fd = libc::c_int;
-static mut VERBOSITY : u8 = 0_u8;
+lazy_static! {
+ static ref VERBOSITY: Mutex<bool> = false;
+}
macro_rules! vrb {
- ( $( $e:expr ),* ) => (
- if unsafe { VERBOSITY } > 0_u8 { println!( $( $e ),* ) }
- )
+ ( $( $e:expr ),* ) => {(
+ if VERBOSITY.lock().unwrap() { println!( $( $e ),* ) }
+ )}
}
const PALETTE_SIZE : usize = 16_usize;
@@ -159,7 +160,9 @@ impl<'a> Job {
unsafe { exit(0) };
};
- if matches.opt_present("v") { unsafe { VERBOSITY = 1_u8; } };
+ if matches.opt_present("v") {
+ VERBOSITY.lock().unwrap() = true;
+ }
if matches.opt_present("l") {
Job::schemes();