diff --git a/ChangeLog b/ChangeLog index a83ddf446..ef111e58d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-02-07 Holger Vogt + * device.c, inpcom.c + alter and altermod commands reinstated and improved + 2009-02-01 Dietmar Warning * alloc.c, outitf.c: exclude heap usage for windows compile under __MINGW__ * resource.c: meminfo api usage not for commandline version diff --git a/src/frontend/device.c b/src/frontend/device.c index 549301ebb..c9db1f69a 100644 --- a/src/frontend/device.c +++ b/src/frontend/device.c @@ -26,17 +26,17 @@ static void all_show(wordlist *wl, int mode); static void all_show_old(wordlist *wl, int mode); /* - * show: list device operating point info - * show - * show devs : params - * show devs : params ; devs : params - * show dev dev dev : param param param , dev dev : param param - * show t : param param param, t : param param + * show: list device operating point info + * show + * show devs : params + * show devs : params ; devs : params + * show dev dev dev : param param param , dev dev : param param + * show t : param param param, t : param param * */ -static int count; +static int count; void @@ -64,13 +64,13 @@ com_show(wordlist *wl) static void all_show(wordlist *wl, int mode) { - wordlist *params, *nextgroup, *thisgroup; - wordlist *prev, *next, *w; - int screen_width; - dgen *dg, *listdg; - int instances; - int i, j, n; - int param_flag, dev_flag; + wordlist *params, *nextgroup, *thisgroup; + wordlist *prev, *next, *w; + int screen_width; + dgen *dg, *listdg; + int instances; + int i, j, n; + int param_flag, dev_flag; if (!ft_curckt) { fprintf(cp_err, "Error: no circuit loaded\n"); @@ -78,163 +78,163 @@ all_show(wordlist *wl, int mode) } if (wl && wl->wl_word && eq(wl->wl_word, "-v")) { - old_show(wl->wl_next); - return; + old_show(wl->wl_next); + return; } if (!cp_getvar("width", VT_NUM, (char *) &screen_width)) - screen_width = DEF_WIDTH; + screen_width = DEF_WIDTH; count = (screen_width - LEFT_WIDTH) / (DEV_WIDTH + 1); count = 1; n = 0; do { - prev = NULL; - params = NULL; - nextgroup = NULL; - thisgroup = wl; - param_flag = 0; - dev_flag = 0; - - /* find the parameter list and the nextgroup */ - for (w = wl; w && !nextgroup; w = next) { - next = w->wl_next; - - if ( eq(w->wl_word, "*") ) { - tfree(w->wl_word); - w->wl_word = strdup("all"); - } + prev = NULL; + params = NULL; + nextgroup = NULL; + thisgroup = wl; + param_flag = 0; + dev_flag = 0; + + /* find the parameter list and the nextgroup */ + for (w = wl; w && !nextgroup; w = next) { + next = w->wl_next; + + if ( eq(w->wl_word, "*") ) { + tfree(w->wl_word); + w->wl_word = strdup("all"); + } - if (eq(w->wl_word, "++") || eq(w->wl_word, "all")) { - if (params) { - param_flag = DGEN_ALLPARAMS; - if (prev) - prev->wl_next = w->wl_next; - else - params = next; - } else { - dev_flag = DGEN_ALLDEVS; - if (prev) - prev->wl_next = w->wl_next; - else - thisgroup = next; - } - /* w must not be freed here */ - w = NULL; - } else if (eq(w->wl_word, "+")) { - if (params) { - param_flag = DGEN_DEFPARAMS; - if (prev) - prev->wl_next = w->wl_next; - else - params = next; - } else { - dev_flag = DGEN_DEFDEVS; - if (prev) - prev->wl_next = w->wl_next; - else - thisgroup = next; - } - /* w must not be freed here */ - w = NULL; - } else if (eq(w->wl_word, ":")) { - /* w must not be freed here */ - w = NULL; - if (!params) { - params = next; - if (prev) - prev->wl_next = NULL; - else - thisgroup = NULL; - } else { - if (prev) - prev->wl_next = next; - else - params = next; - } - } else if (eq(w->wl_word, ";") || eq(w->wl_word, ",")) { - nextgroup = next; - /* w must not be freed here */ - w = NULL; - if (prev) - prev->wl_next = NULL; - break; - } - prev = w; - } - - instances = 0; - for (dg = dgen_init(ft_curckt->ci_ckt, thisgroup, 1, dev_flag, mode); - dg; dgen_nth_next(&dg, count)) - { - instances = 1; - if (dg->flags & DGEN_INSTANCE) { - instances = 2; - n += 1; - - fprintf(cp_out,"%s:\n", dg->instance->GENname); - fprintf(cp_out," %-19s= %s\n", "model", dg->model->GENmodName); - - listdg = dg; - - if (param_flag) { - param_forall(dg, param_flag); - } - else if (!params) { - param_forall(dg, DGEN_DEFPARAMS); - } - if (params) { - wl_forall(params, listparam, dg); - } - - } else if (ft_sim->devices[dg->dev_type_no]->numModelParms) { - fprintf(cp_out," %s models (%s)\n", - ft_sim->devices[dg->dev_type_no]->name, - ft_sim->devices[dg->dev_type_no]->description); - n += 1; - i = 0; - do { - fprintf(cp_out,"%*s", LEFT_WIDTH, "model"); - j = dgen_for_n(dg, count, printstr, "m", i); - i += 1; - fprintf(cp_out,"\n"); - } while (j); - fprintf(cp_out,"\n"); - - if (param_flag) - param_forall(dg, param_flag); - else if (!params) - param_forall(dg, DGEN_DEFPARAMS); - if (params) - wl_forall(params, listparam, dg); - fprintf(cp_out,"\n"); - } - } - - wl = nextgroup; + if (eq(w->wl_word, "++") || eq(w->wl_word, "all")) { + if (params) { + param_flag = DGEN_ALLPARAMS; + if (prev) + prev->wl_next = w->wl_next; + else + params = next; + } else { + dev_flag = DGEN_ALLDEVS; + if (prev) + prev->wl_next = w->wl_next; + else + thisgroup = next; + } + /* w must not be freed here */ + w = NULL; + } else if (eq(w->wl_word, "+")) { + if (params) { + param_flag = DGEN_DEFPARAMS; + if (prev) + prev->wl_next = w->wl_next; + else + params = next; + } else { + dev_flag = DGEN_DEFDEVS; + if (prev) + prev->wl_next = w->wl_next; + else + thisgroup = next; + } + /* w must not be freed here */ + w = NULL; + } else if (eq(w->wl_word, ":")) { + /* w must not be freed here */ + w = NULL; + if (!params) { + params = next; + if (prev) + prev->wl_next = NULL; + else + thisgroup = NULL; + } else { + if (prev) + prev->wl_next = next; + else + params = next; + } + } else if (eq(w->wl_word, ";") || eq(w->wl_word, ",")) { + nextgroup = next; + /* w must not be freed here */ + w = NULL; + if (prev) + prev->wl_next = NULL; + break; + } + prev = w; + } + + instances = 0; + for (dg = dgen_init(ft_curckt->ci_ckt, thisgroup, 1, dev_flag, mode); + dg; dgen_nth_next(&dg, count)) + { + instances = 1; + if (dg->flags & DGEN_INSTANCE) { + instances = 2; + n += 1; + + fprintf(cp_out,"%s:\n", dg->instance->GENname); + fprintf(cp_out," %-19s= %s\n", "model", dg->model->GENmodName); + + listdg = dg; + + if (param_flag) { + param_forall(dg, param_flag); + } + else if (!params) { + param_forall(dg, DGEN_DEFPARAMS); + } + if (params) { + wl_forall(params, listparam, dg); + } + + } else if (ft_sim->devices[dg->dev_type_no]->numModelParms) { + fprintf(cp_out," %s models (%s)\n", + ft_sim->devices[dg->dev_type_no]->name, + ft_sim->devices[dg->dev_type_no]->description); + n += 1; + i = 0; + do { + fprintf(cp_out,"%*s", LEFT_WIDTH, "model"); + j = dgen_for_n(dg, count, printstr, "m", i); + i += 1; + fprintf(cp_out,"\n"); + } while (j); + fprintf(cp_out,"\n"); + + if (param_flag) + param_forall(dg, param_flag); + else if (!params) + param_forall(dg, DGEN_DEFPARAMS); + if (params) + wl_forall(params, listparam, dg); + fprintf(cp_out,"\n"); + } + } + + wl = nextgroup; } while (wl); if (!n) { - if (instances == 0) - printf("No matching instances or models\n"); - else if (instances == 1) - printf("No matching models\n"); - else - printf("No matching elements\n"); + if (instances == 0) + printf("No matching instances or models\n"); + else if (instances == 1) + printf("No matching models\n"); + else + printf("No matching elements\n"); } } static void all_show_old(wordlist *wl, int mode) { - wordlist *params, *nextgroup, *thisgroup; - wordlist *prev, *next, *w; - int screen_width; - dgen *dg, *listdg; - int instances; - int i, j, n; - int param_flag, dev_flag; + wordlist *params, *nextgroup, *thisgroup; + wordlist *prev, *next, *w; + int screen_width; + dgen *dg, *listdg; + int instances; + int i, j, n; + int param_flag, dev_flag; if (!ft_curckt) { fprintf(cp_err, "Error: no circuit loaded\n"); @@ -242,164 +242,164 @@ all_show_old(wordlist *wl, int mode) } if (wl && wl->wl_word && eq(wl->wl_word, "-v")) { - old_show(wl->wl_next); - return; + old_show(wl->wl_next); + return; } if (!cp_getvar("width", VT_NUM, (char *) &screen_width)) - screen_width = DEF_WIDTH; + screen_width = DEF_WIDTH; count = (screen_width - LEFT_WIDTH) / (DEV_WIDTH + 1); n = 0; do { - prev = NULL; - params = NULL; - nextgroup = NULL; - thisgroup = wl; - param_flag = 0; - dev_flag = 0; - - /* find the parameter list and the nextgroup */ - for (w = wl; w && !nextgroup; w = next) { - next = w->wl_next; - - if ( eq(w->wl_word, "*") ) { - tfree(w->wl_word); - w->wl_word = strdup("all"); - } + prev = NULL; + params = NULL; + nextgroup = NULL; + thisgroup = wl; + param_flag = 0; + dev_flag = 0; + + /* find the parameter list and the nextgroup */ + for (w = wl; w && !nextgroup; w = next) { + next = w->wl_next; + + if ( eq(w->wl_word, "*") ) { + tfree(w->wl_word); + w->wl_word = strdup("all"); + } - if (eq(w->wl_word, "++") || eq(w->wl_word, "all")) { - if (params) { - param_flag = DGEN_ALLPARAMS; - if (prev) - prev->wl_next = w->wl_next; - else - params = next; - } else { - dev_flag = DGEN_ALLDEVS; - if (prev) - prev->wl_next = w->wl_next; - else - thisgroup = next; - } - /* w must not be freed here */ - w = NULL; - } else if (eq(w->wl_word, "+")) { - if (params) { - param_flag = DGEN_DEFPARAMS; - if (prev) - prev->wl_next = w->wl_next; - else - params = next; - } else { - dev_flag = DGEN_DEFDEVS; - if (prev) - prev->wl_next = w->wl_next; - else - thisgroup = next; - } - /* w must not be freed here */ - w = NULL; - } else if (eq(w->wl_word, ":")) { - /* w must not be freed here */ - w = NULL; - if (!params) { - params = next; - if (prev) - prev->wl_next = NULL; - else - thisgroup = NULL; - } else { - if (prev) - prev->wl_next = next; - else - params = next; - } - } else if (eq(w->wl_word, ";") || eq(w->wl_word, ",")) { - nextgroup = next; - /* w must not be freed here */ - w = NULL; - if (prev) - prev->wl_next = NULL; - break; - } - prev = w; - } - - instances = 0; - for (dg = dgen_init(ft_curckt->ci_ckt, thisgroup, 1, dev_flag, mode); - dg; dgen_nth_next(&dg, count)) - { - instances = 1; - if (dg->flags & DGEN_INSTANCE) { - instances = 2; - fprintf(cp_out," %s: %s\n", - ft_sim->devices[dg->dev_type_no]->name, - ft_sim->devices[dg->dev_type_no]->description); - n += 1; - - i = 0; - do { - fprintf(cp_out,"%*s", LEFT_WIDTH, "device"); - j = dgen_for_n(dg, count, printstr, "n", i); - i += 1; - fprintf(cp_out,"\n"); - } while (j); - - if (ft_sim->devices[dg->dev_type_no]->numModelParms) { - i = 0; - do { - fprintf(cp_out,"%*s", LEFT_WIDTH, "model"); - j = dgen_for_n(dg, count, printstr, "m", i); - i += 1; - fprintf(cp_out,"\n"); - } while (j); - } - listdg = dg; - - if (param_flag) - param_forall_old(dg, param_flag); - else if (!params) - param_forall_old(dg, DGEN_DEFPARAMS); - if (params) - wl_forall(params, listparam, dg); - fprintf(cp_out,"\n"); - - } else if (ft_sim->devices[dg->dev_type_no]->numModelParms) { - fprintf(cp_out," %s models (%s)\n", - ft_sim->devices[dg->dev_type_no]->name, - ft_sim->devices[dg->dev_type_no]->description); - n += 1; - i = 0; - do { - fprintf(cp_out,"%*s", LEFT_WIDTH, "model"); - j = dgen_for_n(dg, count, printstr, "m", i); - i += 1; - fprintf(cp_out,"\n"); - } while (j); - fprintf(cp_out,"\n"); - - if (param_flag) - param_forall_old(dg, param_flag); - else if (!params) - param_forall_old(dg, DGEN_DEFPARAMS); - if (params) - wl_forall(params, listparam, dg); - fprintf(cp_out,"\n"); - } - } - - wl = nextgroup; + if (eq(w->wl_word, "++") || eq(w->wl_word, "all")) { + if (params) { + param_flag = DGEN_ALLPARAMS; + if (prev) + prev->wl_next = w->wl_next; + else + params = next; + } else { + dev_flag = DGEN_ALLDEVS; + if (prev) + prev->wl_next = w->wl_next; + else + thisgroup = next; + } + /* w must not be freed here */ + w = NULL; + } else if (eq(w->wl_word, "+")) { + if (params) { + param_flag = DGEN_DEFPARAMS; + if (prev) + prev->wl_next = w->wl_next; + else + params = next; + } else { + dev_flag = DGEN_DEFDEVS; + if (prev) + prev->wl_next = w->wl_next; + else + thisgroup = next; + } + /* w must not be freed here */ + w = NULL; + } else if (eq(w->wl_word, ":")) { + /* w must not be freed here */ + w = NULL; + if (!params) { + params = next; + if (prev) + prev->wl_next = NULL; + else + thisgroup = NULL; + } else { + if (prev) + prev->wl_next = next; + else + params = next; + } + } else if (eq(w->wl_word, ";") || eq(w->wl_word, ",")) { + nextgroup = next; + /* w must not be freed here */ + w = NULL; + if (prev) + prev->wl_next = NULL; + break; + } + prev = w; + } + + instances = 0; + for (dg = dgen_init(ft_curckt->ci_ckt, thisgroup, 1, dev_flag, mode); + dg; dgen_nth_next(&dg, count)) + { + instances = 1; + if (dg->flags & DGEN_INSTANCE) { + instances = 2; + fprintf(cp_out," %s: %s\n", + ft_sim->devices[dg->dev_type_no]->name, + ft_sim->devices[dg->dev_type_no]->description); + n += 1; + + i = 0; + do { + fprintf(cp_out,"%*s", LEFT_WIDTH, "device"); + j = dgen_for_n(dg, count, printstr, "n", i); + i += 1; + fprintf(cp_out,"\n"); + } while (j); + + if (ft_sim->devices[dg->dev_type_no]->numModelParms) { + i = 0; + do { + fprintf(cp_out,"%*s", LEFT_WIDTH, "model"); + j = dgen_for_n(dg, count, printstr, "m", i); + i += 1; + fprintf(cp_out,"\n"); + } while (j); + } + listdg = dg; + + if (param_flag) + param_forall_old(dg, param_flag); + else if (!params) + param_forall_old(dg, DGEN_DEFPARAMS); + if (params) + wl_forall(params, listparam, dg); + fprintf(cp_out,"\n"); + + } else if (ft_sim->devices[dg->dev_type_no]->numModelParms) { + fprintf(cp_out," %s models (%s)\n", + ft_sim->devices[dg->dev_type_no]->name, + ft_sim->devices[dg->dev_type_no]->description); + n += 1; + i = 0; + do { + fprintf(cp_out,"%*s", LEFT_WIDTH, "model"); + j = dgen_for_n(dg, count, printstr, "m", i); + i += 1; + fprintf(cp_out,"\n"); + } while (j); + fprintf(cp_out,"\n"); + + if (param_flag) + param_forall_old(dg, param_flag); + else if (!params) + param_forall_old(dg, DGEN_DEFPARAMS); + if (params) + wl_forall(params, listparam, dg); + fprintf(cp_out,"\n"); + } + } + + wl = nextgroup; } while (wl); if (!n) { - if (instances == 0) - printf("No matching instances or models\n"); - else if (instances == 1) - printf("No matching models\n"); - else - printf("No matching elements\n"); + if (instances == 0) + printf("No matching instances or models\n"); + else if (instances == 1) + printf("No matching models\n"); + else + printf("No matching elements\n"); } } @@ -408,15 +408,15 @@ printstr(dgen *dg, char *name) { /* va: ' ' is no flag for %s; \? avoids trigraph warning */ if (*name == 'n') { - if (dg->instance) - fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, dg->instance->GENname); - else - fprintf(cp_out," %*s", DEV_WIDTH, "<\?\?\?\?\?\?\?>"); + if (dg->instance) + fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, dg->instance->GENname); + else + fprintf(cp_out," %*s", DEV_WIDTH, "<\?\?\?\?\?\?\?>"); } else if (*name == 'm') { - if (dg->model) - fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, dg->model->GENmodName); - else - fprintf(cp_out," %*s", DEV_WIDTH, "<\?\?\?\?\?\?\?>"); + if (dg->model) + fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, dg->model->GENmodName); + else + fprintf(cp_out," %*s", DEV_WIDTH, "<\?\?\?\?\?\?\?>"); } else fprintf(cp_out," %*s", DEV_WIDTH, ""); @@ -426,145 +426,145 @@ printstr(dgen *dg, char *name) void param_forall(dgen *dg, int flags) { - int i, j, k, found; + int i, j, k, found; int xcount; IFparm *plist; found = 0; if (dg->flags & DGEN_INSTANCE) { - xcount = *ft_sim->devices[dg->dev_type_no]->numInstanceParms; - plist = ft_sim->devices[dg->dev_type_no]->instanceParms; + xcount = *ft_sim->devices[dg->dev_type_no]->numInstanceParms; + plist = ft_sim->devices[dg->dev_type_no]->instanceParms; } else { - xcount = *ft_sim->devices[dg->dev_type_no]->numModelParms; - plist = ft_sim->devices[dg->dev_type_no]->modelParms; + xcount = *ft_sim->devices[dg->dev_type_no]->numModelParms; + plist = ft_sim->devices[dg->dev_type_no]->modelParms; } for (i = 0; i < xcount; i++) { - if (plist[i].dataType & IF_ASK) { - if ((((CKTcircuit *) (dg->ckt))->CKTrhsOld - || (plist[i].dataType & IF_SET)) - && (!(plist[i].dataType & (IF_REDUNDANT | IF_UNINTERESTING)) - || (flags == DGEN_ALLPARAMS - && !(plist[i].dataType & IF_REDUNDANT)))) - { - j = 0; - do { - fprintf(cp_out," %-19s=", plist[i].keyword); - - k = dgen_for_n(dg, count, printvals, (plist + i), j); - fprintf(cp_out,"\n"); - j += 1; - - } while (k); - } - } + if (plist[i].dataType & IF_ASK) { + if ((((CKTcircuit *) (dg->ckt))->CKTrhsOld + || (plist[i].dataType & IF_SET)) + && (!(plist[i].dataType & (IF_REDUNDANT | IF_UNINTERESTING)) + || (flags == DGEN_ALLPARAMS + && !(plist[i].dataType & IF_REDUNDANT)))) + { + j = 0; + do { + fprintf(cp_out," %-19s=", plist[i].keyword); + + k = dgen_for_n(dg, count, printvals, (plist + i), j); + fprintf(cp_out,"\n"); + j += 1; + + } while (k); + } + } } } void param_forall_old(dgen *dg, int flags) { - int i, j, k, found; + int i, j, k, found; int xcount; IFparm *plist; found = 0; if (dg->flags & DGEN_INSTANCE) { - xcount = *ft_sim->devices[dg->dev_type_no]->numInstanceParms; - plist = ft_sim->devices[dg->dev_type_no]->instanceParms; + xcount = *ft_sim->devices[dg->dev_type_no]->numInstanceParms; + plist = ft_sim->devices[dg->dev_type_no]->instanceParms; } else { - xcount = *ft_sim->devices[dg->dev_type_no]->numModelParms; - plist = ft_sim->devices[dg->dev_type_no]->modelParms; + xcount = *ft_sim->devices[dg->dev_type_no]->numModelParms; + plist = ft_sim->devices[dg->dev_type_no]->modelParms; } for (i = 0; i < xcount; i++) { - if (plist[i].dataType & IF_ASK) { - if ((((CKTcircuit *) (dg->ckt))->CKTrhsOld - || (plist[i].dataType & IF_SET)) - && (!(plist[i].dataType & (IF_REDUNDANT | IF_UNINTERESTING)) - || (flags == DGEN_ALLPARAMS - && !(plist[i].dataType & IF_REDUNDANT)))) - { - j = 0; - do { - if (!j) - fprintf(cp_out,"%*.*s", LEFT_WIDTH, LEFT_WIDTH, - plist[i].keyword); - else - fprintf(cp_out,"%*.*s", LEFT_WIDTH, LEFT_WIDTH, " "); - k = dgen_for_n(dg, count, printvals_old, (plist + i), j); - fprintf(cp_out,"\n"); - j += 1; - } while (k); - } - } + if (plist[i].dataType & IF_ASK) { + if ((((CKTcircuit *) (dg->ckt))->CKTrhsOld + || (plist[i].dataType & IF_SET)) + && (!(plist[i].dataType & (IF_REDUNDANT | IF_UNINTERESTING)) + || (flags == DGEN_ALLPARAMS + && !(plist[i].dataType & IF_REDUNDANT)))) + { + j = 0; + do { + if (!j) + fprintf(cp_out,"%*.*s", LEFT_WIDTH, LEFT_WIDTH, + plist[i].keyword); + else + fprintf(cp_out,"%*.*s", LEFT_WIDTH, LEFT_WIDTH, " "); + k = dgen_for_n(dg, count, printvals_old, (plist + i), j); + fprintf(cp_out,"\n"); + j += 1; + } while (k); + } + } } } void listparam(wordlist *p, dgen *dg) { - int i, j, k, found; - int xcount; + int i, j, k, found; + int xcount; IFparm *plist; found = 0; if (dg->flags & DGEN_INSTANCE) { - xcount = *ft_sim->devices[dg->dev_type_no]->numInstanceParms; - plist = ft_sim->devices[dg->dev_type_no]->instanceParms; + xcount = *ft_sim->devices[dg->dev_type_no]->numInstanceParms; + plist = ft_sim->devices[dg->dev_type_no]->instanceParms; } else { - xcount = *ft_sim->devices[dg->dev_type_no]->numModelParms; - plist = ft_sim->devices[dg->dev_type_no]->modelParms; + xcount = *ft_sim->devices[dg->dev_type_no]->numModelParms; + plist = ft_sim->devices[dg->dev_type_no]->modelParms; } for (i = 0; i < xcount; i++) { - if (eqc(p->wl_word, plist[i].keyword) && (plist[i].dataType & IF_ASK)) - { - found = 1; - break; - } + if (eqc(p->wl_word, plist[i].keyword) && (plist[i].dataType & IF_ASK)) + { + found = 1; + break; + } } if (found) { - if ((((CKTcircuit *) (dg->ckt))->CKTrhsOld - || (plist[i].dataType & IF_SET))) - { - j = 0; - do { - if (!j) - fprintf(cp_out,"%*.*s", LEFT_WIDTH, LEFT_WIDTH, p->wl_word); - else - fprintf(cp_out,"%*.*s", LEFT_WIDTH, LEFT_WIDTH, " "); - k = dgen_for_n(dg, count, printvals_old, (plist + i), j); - printf("\n"); - j += 1; - } while (k > 0); - } else { - j = 0; - do { - if (!j) - fprintf(cp_out,"%*.*s", LEFT_WIDTH, LEFT_WIDTH, p->wl_word); - else - fprintf(cp_out,"%*s", LEFT_WIDTH, " "); - k = dgen_for_n(dg, count, bogus1, 0, j); - fprintf(cp_out,"\n"); - j += 1; - } while (k > 0); - } + if ((((CKTcircuit *) (dg->ckt))->CKTrhsOld + || (plist[i].dataType & IF_SET))) + { + j = 0; + do { + if (!j) + fprintf(cp_out,"%*.*s", LEFT_WIDTH, LEFT_WIDTH, p->wl_word); + else + fprintf(cp_out,"%*.*s", LEFT_WIDTH, LEFT_WIDTH, " "); + k = dgen_for_n(dg, count, printvals_old, (plist + i), j); + printf("\n"); + j += 1; + } while (k > 0); + } else { + j = 0; + do { + if (!j) + fprintf(cp_out,"%*.*s", LEFT_WIDTH, LEFT_WIDTH, p->wl_word); + else + fprintf(cp_out,"%*s", LEFT_WIDTH, " "); + k = dgen_for_n(dg, count, bogus1, 0, j); + fprintf(cp_out,"\n"); + j += 1; + } while (k > 0); + } } else { - j = 0; - do { - if (!j) - fprintf(cp_out,"%*.*s", LEFT_WIDTH, LEFT_WIDTH, p->wl_word); - else - fprintf(cp_out,"%*s", LEFT_WIDTH, " "); - k = dgen_for_n(dg, count, bogus2, 0, j); - fprintf(cp_out,"\n"); - j += 1; - } while (k > 0); + j = 0; + do { + if (!j) + fprintf(cp_out,"%*.*s", LEFT_WIDTH, LEFT_WIDTH, p->wl_word); + else + fprintf(cp_out,"%*s", LEFT_WIDTH, " "); + k = dgen_for_n(dg, count, bogus2, 0, j); + fprintf(cp_out,"\n"); + j += 1; + } while (k > 0); } } @@ -583,85 +583,85 @@ int bogus2(dgen *dg) int printvals(dgen *dg, IFparm *p, int i) { - IFvalue val; - int n; + IFvalue val; + int n; if (dg->flags & DGEN_INSTANCE) - (*ft_sim->askInstanceQuest)(ft_curckt->ci_ckt, dg->instance, - p->id, &val, &val); + (*ft_sim->askInstanceQuest)(ft_curckt->ci_ckt, dg->instance, + p->id, &val, &val); else - (*ft_sim->askModelQuest)(ft_curckt->ci_ckt, dg->model, - p->id, &val, &val); + (*ft_sim->askModelQuest)(ft_curckt->ci_ckt, dg->model, + p->id, &val, &val); if (p->dataType & IF_VECTOR) - n = val.v.numValue; + n = val.v.numValue; else - n = 1; + n = 1; if (((p->dataType & IF_VARTYPES) & ~IF_VECTOR) == IF_COMPLEX) - n *= 2; + n *= 2; if (i >= n) { - if (i == 0) - fprintf(cp_out," -"); - else - fprintf(cp_out," "); - return 0; + if (i == 0) + fprintf(cp_out," -"); + else + fprintf(cp_out," "); + return 0; } if (p->dataType & IF_VECTOR) { /* va: ' ' is no flag for %s */ - switch ((p->dataType & IF_VARTYPES) & ~IF_VECTOR) { - case IF_FLAG: - fprintf(cp_out," %d", val.v.vec.iVec[i]); - break; - case IF_INTEGER: - fprintf(cp_out," %d", val.v.vec.iVec[i]); - break; - case IF_REAL: - fprintf(cp_out," %.6g", val.v.vec.rVec[i]); - break; - case IF_COMPLEX: - if (!(i % 2)) - fprintf(cp_out," %.6g", val.v.vec.cVec[i / 2].real); - else - fprintf(cp_out," %.6g", val.v.vec.cVec[i / 2].imag); - break; - case IF_STRING: - fprintf(cp_out," %s", val.v.vec.sVec[i]); - break; - case IF_INSTANCE: - fprintf(cp_out," %s", val.v.vec.uVec[i]); - break; - default: - fprintf(cp_out," %s", " ******** "); - } + switch ((p->dataType & IF_VARTYPES) & ~IF_VECTOR) { + case IF_FLAG: + fprintf(cp_out," %d", val.v.vec.iVec[i]); + break; + case IF_INTEGER: + fprintf(cp_out," %d", val.v.vec.iVec[i]); + break; + case IF_REAL: + fprintf(cp_out," %.6g", val.v.vec.rVec[i]); + break; + case IF_COMPLEX: + if (!(i % 2)) + fprintf(cp_out," %.6g", val.v.vec.cVec[i / 2].real); + else + fprintf(cp_out," %.6g", val.v.vec.cVec[i / 2].imag); + break; + case IF_STRING: + fprintf(cp_out," %s", val.v.vec.sVec[i]); + break; + case IF_INSTANCE: + fprintf(cp_out," %s", val.v.vec.uVec[i]); + break; + default: + fprintf(cp_out," %s", " ******** "); + } } else { - switch ((p->dataType & IF_VARTYPES) & ~IF_VECTOR) { - case IF_FLAG: - fprintf(cp_out," %d", val.iValue); - break; - case IF_INTEGER: - fprintf(cp_out," %d", val.iValue); - break; - case IF_REAL: - fprintf(cp_out," %.6g", val.rValue); - break; - case IF_COMPLEX: - if (i % 2) - fprintf(cp_out," %.6g", val.cValue.real); - else - fprintf(cp_out," %.6g", val.cValue.imag); - break; - case IF_STRING: - fprintf(cp_out," %s", val.sValue); - break; - case IF_INSTANCE: - fprintf(cp_out," %s", val.uValue); - break; - default: - fprintf(cp_out," %s", " ******** "); - } + switch ((p->dataType & IF_VARTYPES) & ~IF_VECTOR) { + case IF_FLAG: + fprintf(cp_out," %d", val.iValue); + break; + case IF_INTEGER: + fprintf(cp_out," %d", val.iValue); + break; + case IF_REAL: + fprintf(cp_out," %.6g", val.rValue); + break; + case IF_COMPLEX: + if (i % 2) + fprintf(cp_out," %.6g", val.cValue.real); + else + fprintf(cp_out," %.6g", val.cValue.imag); + break; + case IF_STRING: + fprintf(cp_out," %s", val.sValue); + break; + case IF_INSTANCE: + fprintf(cp_out," %s", val.uValue); + break; + default: + fprintf(cp_out," %s", " ******** "); + } } return n - 1; @@ -670,85 +670,85 @@ printvals(dgen *dg, IFparm *p, int i) int printvals_old(dgen *dg, IFparm *p, int i) { - IFvalue val; - int n; + IFvalue val; + int n; if (dg->flags & DGEN_INSTANCE) - (*ft_sim->askInstanceQuest)(ft_curckt->ci_ckt, dg->instance, - p->id, &val, &val); + (*ft_sim->askInstanceQuest)(ft_curckt->ci_ckt, dg->instance, + p->id, &val, &val); else - (*ft_sim->askModelQuest)(ft_curckt->ci_ckt, dg->model, - p->id, &val, &val); + (*ft_sim->askModelQuest)(ft_curckt->ci_ckt, dg->model, + p->id, &val, &val); if (p->dataType & IF_VECTOR) - n = val.v.numValue; + n = val.v.numValue; else - n = 1; + n = 1; if (((p->dataType & IF_VARTYPES) & ~IF_VECTOR) == IF_COMPLEX) - n *= 2; + n *= 2; if (i >= n) { - if (i == 0) - fprintf(cp_out," -"); - else - fprintf(cp_out," "); - return 0; + if (i == 0) + fprintf(cp_out," -"); + else + fprintf(cp_out," "); + return 0; } if (p->dataType & IF_VECTOR) { /* va: ' ' is no flag for %s */ - switch ((p->dataType & IF_VARTYPES) & ~IF_VECTOR) { - case IF_FLAG: - fprintf(cp_out," % *d", DEV_WIDTH, val.v.vec.iVec[i]); - break; - case IF_INTEGER: - fprintf(cp_out," % *d", DEV_WIDTH, val.v.vec.iVec[i]); - break; - case IF_REAL: - fprintf(cp_out," % *.6g", DEV_WIDTH, val.v.vec.rVec[i]); - break; - case IF_COMPLEX: - if (!(i % 2)) - fprintf(cp_out," % *.6g", DEV_WIDTH, val.v.vec.cVec[i / 2].real); - else - fprintf(cp_out," % *.6g", DEV_WIDTH, val.v.vec.cVec[i / 2].imag); - break; - case IF_STRING: - fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, val.v.vec.sVec[i]); - break; - case IF_INSTANCE: - fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, val.v.vec.uVec[i]); - break; - default: - fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, " ******** "); - } + switch ((p->dataType & IF_VARTYPES) & ~IF_VECTOR) { + case IF_FLAG: + fprintf(cp_out," % *d", DEV_WIDTH, val.v.vec.iVec[i]); + break; + case IF_INTEGER: + fprintf(cp_out," % *d", DEV_WIDTH, val.v.vec.iVec[i]); + break; + case IF_REAL: + fprintf(cp_out," % *.6g", DEV_WIDTH, val.v.vec.rVec[i]); + break; + case IF_COMPLEX: + if (!(i % 2)) + fprintf(cp_out," % *.6g", DEV_WIDTH, val.v.vec.cVec[i / 2].real); + else + fprintf(cp_out," % *.6g", DEV_WIDTH, val.v.vec.cVec[i / 2].imag); + break; + case IF_STRING: + fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, val.v.vec.sVec[i]); + break; + case IF_INSTANCE: + fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, val.v.vec.uVec[i]); + break; + default: + fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, " ******** "); + } } else { - switch ((p->dataType & IF_VARTYPES) & ~IF_VECTOR) { - case IF_FLAG: - fprintf(cp_out," % *d", DEV_WIDTH, val.iValue); - break; - case IF_INTEGER: - fprintf(cp_out," % *d", DEV_WIDTH, val.iValue); - break; - case IF_REAL: - fprintf(cp_out," % *.6g", DEV_WIDTH, val.rValue); - break; - case IF_COMPLEX: - if (i % 2) - fprintf(cp_out," % *.6g", DEV_WIDTH, val.cValue.real); - else - fprintf(cp_out," % *.6g", DEV_WIDTH, val.cValue.imag); - break; - case IF_STRING: - fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, val.sValue); - break; - case IF_INSTANCE: - fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, val.uValue); - break; - default: - fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, " ******** "); - } + switch ((p->dataType & IF_VARTYPES) & ~IF_VECTOR) { + case IF_FLAG: + fprintf(cp_out," % *d", DEV_WIDTH, val.iValue); + break; + case IF_INTEGER: + fprintf(cp_out," % *d", DEV_WIDTH, val.iValue); + break; + case IF_REAL: + fprintf(cp_out," % *.6g", DEV_WIDTH, val.rValue); + break; + case IF_COMPLEX: + if (i % 2) + fprintf(cp_out," % *.6g", DEV_WIDTH, val.cValue.real); + else + fprintf(cp_out," % *.6g", DEV_WIDTH, val.cValue.imag); + break; + case IF_STRING: + fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, val.sValue); + break; + case IF_INSTANCE: + fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, val.uValue); + break; + default: + fprintf(cp_out," %*.*s", DEV_WIDTH, DEV_WIDTH, " ******** "); + } } return n - 1; @@ -809,10 +809,10 @@ old_show(wordlist *wl) for (tw = parms; tw; tw = tw->wl_next) { nn = copy(devs->wl_word); v = (*if_getparam)(ft_curckt->ci_ckt, - &nn, tw->wl_word, 0, 0); - if (!v) - v = (*if_getparam)(ft_curckt->ci_ckt, - &nn, tw->wl_word, 0, 1); + &nn, tw->wl_word, 0, 0); + if (!v) + v = (*if_getparam)(ft_curckt->ci_ckt, + &nn, tw->wl_word, 0, 1); if (v) { out_printf("\t%s =", tw->wl_word); for (ww = cp_varwl(v); ww; ww = @@ -824,8 +824,8 @@ old_show(wordlist *wl) } else { nn = copy(devs->wl_word); v = (*if_getparam)(ft_curckt->ci_ckt, &nn, "all", 0, 0); - if (!v) - v = (*if_getparam)(ft_curckt->ci_ckt, &nn, "all", 0, 1); + if (!v) + v = (*if_getparam)(ft_curckt->ci_ckt, &nn, "all", 0, 1); while (v) { out_printf("\t%s =", v->va_name); for (ww = cp_varwl(v); ww; ww = ww->wl_next) @@ -840,9 +840,9 @@ old_show(wordlist *wl) } /* Alter a device parameter. The new syntax here is - * alter @device[parameter] = expr - * alter device = expr - * alter device parameter = expr + * alter @device[parameter] = expr + * alter device = expr + * alter device parameter = expr * expr must be real (complex isn't handled right now, integer is fine though, * but no strings ... for booleans, use 0/1). */ @@ -851,10 +851,10 @@ void com_alter(wordlist *wl) { if (!wl) { - fprintf(cp_err, "usage: alter dev param = expression\n"); - fprintf(cp_err, " or alter @dev[param] = expression\n"); - fprintf(cp_err, " or alter dev = expression\n"); - return; + fprintf(cp_err, "usage: alter dev param = expression\n"); + fprintf(cp_err, " or alter @dev[param] = expression\n"); + fprintf(cp_err, " or alter dev = expression\n"); + return; } com_alter_common(wl, 0); } @@ -873,24 +873,141 @@ com_alter_common(wordlist *wl, int do_model) char *param; struct dvec *dv; struct pnode *names; + + /* DIE 2009_02_06 */ + char *argument; + char **arglist; + int i=0, step=0, n, wlen, maxelem=3; + wordlist *wl2, *wlin, *wleq; + bool eqfound = FALSE, vecfound = FALSE; if (!ft_curckt) { fprintf(cp_err, "Error: no circuit loaded\n"); return; } - words = wl; + /* + wordlist 'wl' will be splitted into a wordlist wl2 with three elements, + containing + 1) '@dev[param]' string (i.e.: the substring before '=' char); + 2) '=' string; + 3) 'expression' string. + + Spaces around the '=' sign have to be removed. This is provided + by inp_remove_excess_ws(). + + If the 'altermod' argument is 'altermod m1 vth0=0.7', 'm1' has to be kept as the + element in wl2 before splitting inserts the three new elements. + If 'expression' is a vector (e.g. [ 1.0 1.2 1.4 ] ), its elements + in wl2 have to follow the splitting. wl_splice() will take care of this. + */ + wlin = wl; + while(wl){ + argument = wl->wl_word; + /* searching for '=' ... */ + while(argument[i]!='=' && argument[i]!='\0'){ + i++; + } + /* ...and if found split argument into three chars and make a new wordlist */ + if(argument[i]!='\0'){ + /* We found '=' */ + eqfound = TRUE; + arglist = (char**)tmalloc(4*sizeof(char*)); + arglist[3] = NULL; + arglist[0] = (char*)tmalloc(i*sizeof(char) + 1); + arglist[2] = (char*)tmalloc(strlen(&argument[i+1])*sizeof(char) + 1); + /* copy argument */ + strncpy(arglist[0],argument,i); + arglist[0][i] = '\0'; + /* copy equal sign */ + arglist[1] = copy("="); + /* copy expression */ + strncpy(arglist[2],&argument[i+1],strlen(&argument[i+1])+1); + + /* create a new wordlist from array arglist */ + wl2 = wl_build(arglist); + /* combine wordlists into wl2, free wl */ + wl_splice(wl, wl2); + wl = NULL; + /* free arglist */ + for (n=0; n < 3; n++) tfree(arglist[n]); + tfree(arglist); + } else { + /* deal with 'altermod m1 vth0=0.7' by moving + forward beyond 'm1' */ + wl = wl->wl_next; + step++; + } + } + + if(eqfound) { + /* step back in the wordlist, if we have moved forward, to catch 'm1' */ + for(n=step;n>0;n--) wl2 = wl2->wl_prev; + } else { + /* no equal sign found, probably a pre3f4 input format + 'alter device value' + 'alter device parameter value' + are supported, + 'alter device parameter value parameter value [ parameter value ]' + multiple param value pairs are not supported! + */ + wl2 = wlin; + wlen = wl_length(wlin); + /* Return the last element of wlin */ + wlin = wl_nthelem(100, wlin); /* no more than 100 vector elements */ + + if (eq(wlin->wl_word, "]"))/* we have a vector */ { + for (n=0;n<100;n++) {/* no more than 100 vector elements */ + wlin=wlin->wl_prev; + maxelem++; + if (eq(wlin->wl_word, "[")) { + vecfound = TRUE; + break; + } + if(wlin->wl_prev==NULL) { + fprintf(cp_err, "Error: '[' is missing.\n"); + fprintf(cp_err, "Cannot alter parameters.\n"); + return; + } + } + } + if(wlen > maxelem) { + fprintf(cp_err, "Error: Only a single param - value pair supported.\n"); + fprintf(cp_err, "Cannot alter parameters.\n"); + return; + } + /* add the '=' */ + /* create wordlist with '=' */ + wleq = (wordlist*)tmalloc(sizeof(wordlist)); + wleq->wl_word = copy("="); + /* add the last element (the value of the param - value pair) */ + wleq->wl_next = wlin; + /* move back one element to place equal sign */ + wlin = wlin->wl_prev; + /* add ' = value' */ + wlin->wl_next = wleq; + /* step back until 'alter' or 'altermod' is found, + then move one step forward */ + while (!ciprefix(wlin->wl_word,"alter")) + wlin = wlin->wl_prev; + wlin = wlin->wl_next; + wl2 = wlin; + } + + /* Everything is ready, parsing of the wordlist starts here. */ + words = wl2; while (words) { - p = words->wl_word; - eqword = words; - words = words->wl_next; - if (eq(p, "=")) { - break; - } + p = words->wl_word; + eqword = words; + words = words->wl_next; + if (eq(p, "=")) { + break; + } } if (!words) { - fprintf(cp_err, "Error: no assignment found.\n"); - return; + fprintf(cp_err, "Error: no assignment found.\n"); + fprintf(cp_err, "Cannot alter parameters.\n"); + return; } /* device parameter = expr @@ -900,91 +1017,94 @@ com_alter_common(wordlist *wl, int do_model) dev = NULL; param = NULL; - words = wl; + words = wl2; while (words != eqword) { - p = words->wl_word; - if (param) { - fprintf(cp_err, "Error: excess parameter name \"%s\" ignored.\n", - p); - } else if (dev) { - param = words->wl_word; - } else if (*p == '@' || *p == '#') { - dev = p + 1; - p =strchr(p, '['); - if (p) { - *p++ = 0; - param = p; - p =strchr(p, ']'); - if (p) - *p = 0; - } - } else { - dev = p; - } - words = words->wl_next; + p = words->wl_word; + if (param) { + fprintf(cp_err, "Error: excess parameter name \"%s\" ignored.\n", + p); + } else if (dev) { + param = words->wl_word; + } else if (*p == '@' || *p == '#') { + dev = p + 1; + p =strchr(p, '['); + if (p) { + *p++ = 0; + param = p; + p =strchr(p, ']'); + if (p) + *p = 0; + } + } else { + dev = p; + } + words = words->wl_next; } if (!dev) { - fprintf(cp_err, "Error: no model or device name provided.\n" ); - return; + fprintf(cp_err, "Error: no model or device name provided.\n" ); + fprintf(cp_err, "Cannot alter parameters.\n"); + return; } words = eqword->wl_next; - names = ft_getpnames(words, FALSE); + /* skip next line if words is a vector */ + if(!eq(words->wl_word, "[")) + names = ft_getpnames(words, FALSE); + else names = NULL; if (!names) { - /* Put this to try to resolve the case of - * alter vin_sin@[sin] = (10 12 3000) - */ - char *xsbuf; - int type = IF_REALVEC,i=0; - - - double *list; - double tmp; - int error; - - xsbuf = wl_flatten(words); - /* fprintf(cp_err, "Chain converted %s \n",xsbuf); */ - dv=(struct dvec *)MALLOC(sizeof(struct dvec)); - dv->v_name = (char *)MALLOC(sizeof("real vector")); - dv->v_name = "real vector"; + /* Put this to try to resolve the case of + alter @vin[pulse] = [ 0 5 10n 10n 10n 50n 100n ] + */ + char *xsbuf; + int type = IF_REALVEC,i=0; + + double *list; + double tmp; + int error; + /* move beyond '[' to allow INPevaluate() */ + if(eq(words->wl_word, "[")) words = words->wl_next; + xsbuf = wl_flatten(words); + /* fprintf(cp_err, "Chain converted %s \n",xsbuf); */ + dv=(struct dvec *)MALLOC(sizeof(struct dvec)); + dv->v_name = (char *)MALLOC(sizeof("real vector")); + dv->v_name = "real vector"; type &= IF_VARTYPES; - if (type == IF_REALVEC) - { - list = (double *)MALLOC(sizeof(double)); - tmp = INPevaluate(&xsbuf,&error,1); - while (error == 0) - { - /*printf(" returning vector value %g\n",tmp); */ - i++; - list=(double *)REALLOC((char *)list,i*sizeof(double)); - *(list+i-1) = tmp; - tmp = INPevaluate(&xsbuf,&error,1); - } - dv->v_realdata=list; + if (type == IF_REALVEC) { + list = (double *)MALLOC(sizeof(double)); + tmp = INPevaluate(&xsbuf,&error,1); + while (error == 0) + { + /*printf(" returning vector value %g\n",tmp); */ + i++; + list=(double *)REALLOC((char *)list,i*sizeof(double)); + *(list+i-1) = tmp; + tmp = INPevaluate(&xsbuf,&error,1); + } + dv->v_realdata=list; } dv->v_length=i; if (!dv) - return; + return; if (dv->v_length < 1) { - fprintf(cp_err, "Error: cannot evaluate new parameter value.\n"); - return; + fprintf(cp_err, "Error: cannot evaluate new parameter value.\n"); + return; } - /* Here I was, to change the inclusion in the circuit. + /* Here I was, to change the inclusion in the circuit. * will have to revise that dv is right for its insertion. */ if_setparam(ft_curckt->ci_ckt, &dev, param, dv, do_model); - return; + return; } dv = ft_evaluate(names); if (!dv) - return; + return; if (dv->v_length < 1) { - fprintf(cp_err, "Error: cannot evaluate new parameter value.\n"); - return; + fprintf(cp_err, "Error: cannot evaluate new parameter value.\n"); + return; } if_setparam(ft_curckt->ci_ckt, &dev, param, dv, do_model); @@ -1024,4 +1144,3 @@ devexpand(char *name) wl_sort(wl); return (wl); } - diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 7c07d2e45..d8f454bff 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1338,9 +1338,9 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name) working->li_next = tmp_ptr; working = tmp_ptr2; - //end = working; - //working = working->li_next; - //end->li_next = NULL; + /* end = working; + * working = working->li_next; + * end->li_next = NULL; */ continue; } @@ -1369,13 +1369,10 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name) tmp_ptr = library_ll_ptr[i][j]->li_next; library_ll_ptr[i][j]->li_next = working; - // renumber lines + /* renumber lines */ for ( start_lib = working; !ciprefix(".endl", start_lib->li_line); start_lib = start_lib->li_next ) - start_lib->li_linenum = line_number++; + start_lib->li_linenum = line_number++; start_lib->li_linenum = line_number++; // renumber endl line - - //end->li_next = working; - break; } } @@ -1804,7 +1801,6 @@ inp_remove_excess_ws(struct line *deck ) struct line *c = deck; while ( c != NULL ) { if ( *c->li_line == '*' ) { c = c->li_next; continue; } - if ( ciprefix( "alter", c->li_line ) ) { c = c->li_next; continue; } c->li_line = inp_remove_ws(c->li_line); c = c->li_next; }