From b2a2a62b7b8a066467d7e8ef520fef7c17e3c5ca Mon Sep 17 00:00:00 2001 From: Bert Date: Sun, 11 Sep 2011 21:01:24 +0200 Subject: Added own bool type --- options.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'options.c') diff --git a/options.c b/options.c index 1e4a56c..13e1174 100644 --- a/options.c +++ b/options.c @@ -17,6 +17,7 @@ */ #define _POSIX_C_SOURCE 200112L +#define _IMAGE_CONFIG #include #include @@ -25,8 +26,6 @@ #include "options.h" #include "util.h" - -#define _IMAGE_CONFIG #include "config.h" options_t _options; @@ -56,20 +55,20 @@ void print_version() { void parse_options(int argc, char **argv) { int opt, t; - _options.recursive = 0; + _options.recursive = false; _options.startnum = 0; _options.scalemode = SCALE_MODE; _options.zoom = 1.0; - _options.aa = 1; + _options.aa = true; - _options.fixed = 0; - _options.fullscreen = 0; + _options.fixed_win = false; + _options.fullscreen = false; _options.geometry = NULL; - _options.quiet = 0; - _options.thumbnails = 0; - _options.clean_cache = 0; + _options.quiet = false; + _options.thumb_mode = false; + _options.clean_cache = false; while ((opt = getopt(argc, argv, "cdFfg:hn:pqrstvZz:")) != -1) { switch (opt) { @@ -77,16 +76,16 @@ void parse_options(int argc, char **argv) { print_usage(); exit(1); case 'c': - _options.clean_cache = 1; + _options.clean_cache = true; break; case 'd': _options.scalemode = SCALE_DOWN; break; case 'F': - _options.fixed = 1; + _options.fixed_win = true; break; case 'f': - _options.fullscreen = 1; + _options.fullscreen = true; break; case 'g': _options.geometry = optarg; @@ -104,19 +103,19 @@ void parse_options(int argc, char **argv) { } break; case 'p': - _options.aa = 0; + _options.aa = false; break; case 'q': - _options.quiet = 1; + _options.quiet = true; break; case 'r': - _options.recursive = 1; + _options.recursive = true; break; case 's': _options.scalemode = SCALE_FIT; break; case 't': - _options.thumbnails = 1; + _options.thumb_mode = true; break; case 'v': print_version(); @@ -140,5 +139,5 @@ void parse_options(int argc, char **argv) { _options.filenames = argv + optind; _options.filecnt = argc - optind; _options.from_stdin = _options.filecnt == 1 && - strcmp(_options.filenames[0], "-") == 0; + !strcmp(_options.filenames[0], "-"); } -- cgit v1.2.3-54-g00ecf