diff --git a/src/options.c b/src/options.c index e7bcc216..b31110e0 100644 --- a/src/options.c +++ b/src/options.c @@ -46,7 +46,7 @@ void check_opt(char *opt, char *optval, int type) dbg(1, "process_options(): set flat netlist\n"); cli_opt_flat_netlist=1; - } else if( (type == SHORT && *opt == 'r') || (type == LONG && !strcmp("cli_opt_no_readline", opt)) ) { + } else if( (type == SHORT && *opt == 'r') || (type == LONG && !strcmp("no_readline", opt)) ) { cli_opt_no_readline=1; } else if( (type == SHORT && *opt == 'p') || (type == LONG && !strcmp("postscript", opt)) ) { @@ -61,8 +61,8 @@ void check_opt(char *opt, char *optval, int type) dbg(1, "process_options(): user plotfile specified: %s\n", optval ? optval : "NULL"); if(optval) my_strncpy(cli_opt_plotfile, optval, S(cli_opt_plotfile)); - } else if( (type == LONG && !strcmp("cli_opt_rcfile", opt)) ) { - dbg(1, "process_options(): user cli_opt_rcfile specified: %s\n", optval ? optval : "NULL"); + } else if( (type == LONG && !strcmp("rcfile", opt)) ) { + dbg(1, "process_options(): user rcfile specified: %s\n", optval ? optval : "NULL"); if(optval) my_strncpy(cli_opt_rcfile, optval, S(cli_opt_rcfile)); } else if( (type == LONG && !strcmp("png", opt)) ) { @@ -191,7 +191,7 @@ int process_options(int argc, char *argv[]) else if(!strcmp("netlist_path", opt)) { optval = argv[++i]; } - else if(!strcmp("cli_opt_rcfile", opt)) { + else if(!strcmp("rcfile", opt)) { optval = argv[++i]; } else if(!strcmp("plotfile", opt)) { diff --git a/src/token.c b/src/token.c index 181fe099..3925435d 100644 --- a/src/token.c +++ b/src/token.c @@ -946,6 +946,32 @@ const char *get_cell_w_ext(const char *str, int no_of_dir) * count number of tokens. Multiple separators and leading/trailing * separators are allowed. */ int count_items(const char *s, const char *sep) +{ + const char *ptr; + int items = 0; + int state = 0; /* 1 if item is being processed */ + int c; + int j, nsep = strlen(sep); + + ptr = s; + while( (c = *(unsigned char *)ptr++) ) { + for(j = 0; j < nsep; j++) { + if(c == sep[j]) break; + } + if(j >= nsep) { /* not a separator */ + if(!state) items++; + state = 1; + } else { + state = 0; + } + } + return items; +} + +/* in a string with tokens separated by characters in 'sep' + * count number of tokens. Multiple separators and leading/trailing + * separators are allowed. */ +int xcount_items(const char *s, const char *sep) { const char *ptr; char table[1 << 8 * sizeof(unsigned char)]; diff --git a/xschem_library/ngspice/autozero_comp.sch b/xschem_library/ngspice/autozero_comp.sch index 78298b01..b7d152ac 100644 --- a/xschem_library/ngspice/autozero_comp.sch +++ b/xschem_library/ngspice/autozero_comp.sch @@ -41,8 +41,9 @@ unitx=n divx=5 subdivx=4 node="plus -minus" -color="4 5"} +minus +\\"plus minus -\\"" +color="4 5 8"} T {CAL} 140 -180 0 1 0.4 0.4 {} T {EN} 140 -130 0 1 0.4 0.4 {} T {CALIBRATION