From: twisti Date: Mon, 4 Jul 2005 20:38:07 +0000 (+0000) Subject: * collectverbose: removed X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=e2b9a20e41333ce3259d9b8a74443b62b6e4461a;p=cacao.git * collectverbose: removed * opt_verbosejni, opt_verbosegc: added --- diff --git a/src/vm/options.c b/src/vm/options.c index 3c2315bbb..edb92bc37 100644 --- a/src/vm/options.c +++ b/src/vm/options.c @@ -26,7 +26,7 @@ Authors: Christian Thalinger - $Id: options.c 2780 2005-06-22 10:51:03Z twisti $ + $Id: options.c 2894 2005-07-04 20:38:07Z twisti $ */ @@ -42,11 +42,12 @@ bool opt_verbose = false; bool compileall = false; bool runverbose = false; /* trace all method invocation */ bool verboseexception = false; -bool collectverbose = false; bool loadverbose = false; bool linkverbose = false; bool initverbose = false; +bool opt_verbosegc = false; +bool opt_verbosejni = false; bool opt_rt = false; /* true if RTA parse should be used RT-CO */ bool opt_xta = false; /* true if XTA parse should be used XTA-CO */ @@ -104,33 +105,44 @@ char *opt_arg; /* this one exports the option argument */ int get_opt(int argc, char **argv, opt_struct *opts) { char *a; - int i; + s4 i; if (opt_ind >= argc) return OPT_DONE; a = argv[opt_ind]; + if (a[0] != '-') return OPT_DONE; for (i = 0; opts[i].name; i++) { if (!opts[i].arg) { - if (strcmp(a + 1, opts[i].name) == 0) { /* boolean option found */ + /* boolean option found */ + + if (strcmp(a + 1, opts[i].name) == 0) { opt_ind++; return opts[i].value; } } else { - if (strcmp(a + 1, opts[i].name) == 0) { /* parameter option found */ + /* parameter option found */ + + /* with a space between */ + + if (strcmp(a + 1, opts[i].name) == 0) { opt_ind++; + if (opt_ind < argc) { opt_arg = argv[opt_ind]; opt_ind++; return opts[i].value; } + return OPT_ERROR; } else { + /* parameter and option have no space between */ + size_t l = strlen(opts[i].name); if (strlen(a + 1) > l) { if (memcmp(a + 1, opts[i].name, l) == 0) { diff --git a/src/vm/options.h b/src/vm/options.h index 98bdb9b3a..ba460525a 100644 --- a/src/vm/options.h +++ b/src/vm/options.h @@ -26,7 +26,7 @@ Authors: Christian Thalinger - $Id: options.h 2780 2005-06-22 10:51:03Z twisti $ + $Id: options.h 2894 2005-07-04 20:38:07Z twisti $ */ @@ -60,11 +60,12 @@ extern bool opt_verbose; extern bool compileall; extern bool runverbose; extern bool verboseexception; -extern bool collectverbose; extern bool loadverbose; /* Print debug messages during loading */ extern bool linkverbose; extern bool initverbose; /* Log class initialization */ +extern bool opt_verbosegc; +extern bool opt_verbosejni; extern bool opt_rt; extern bool opt_xta;