.csparam
This commit is contained in:
parent
7e96dcc639
commit
171e8896b1
|
|
@ -1,6 +1,9 @@
|
|||
2011-12-29 Holger Vogt
|
||||
* inppas3.c, cktdest.c: reduce memory leaks
|
||||
* inpsymt.c: beautify
|
||||
* inp.c: .csparam allows to tranfer a param into a vector
|
||||
for use in the .control section (yet experimental, not safe
|
||||
against syntax errors)
|
||||
|
||||
2011-12-29 Holger Vogt
|
||||
* b4v6dest.c : improved removal of circuit installation,
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ Author: 1985 Wayne A. Christopher
|
|||
#include "subckt.h"
|
||||
#include "spiceif.h"
|
||||
#include "error.h" /* controlled_exit() */
|
||||
#include "com_let.h"
|
||||
|
||||
#ifdef XSPICE
|
||||
/* include new stuff */
|
||||
|
|
@ -556,6 +557,37 @@ inp_spsource(FILE *fp, bool comfile, char *filename)
|
|||
;
|
||||
(void) fclose(fdo);
|
||||
}
|
||||
for(dd = deck; dd != NULL; dd = dd->li_next) {
|
||||
/* get csparams and create vectors */
|
||||
if ( ciprefix(".csparam", dd->li_line) ) {
|
||||
wordlist *wlist = NULL;
|
||||
wordlist *wl = NULL;
|
||||
wordlist *cwl;
|
||||
char *cstoken[3];
|
||||
int i;
|
||||
s = dd->li_line;
|
||||
*s='*';
|
||||
s = dd->li_line + 8;
|
||||
while ( isspace(*s) ) s++;
|
||||
cstoken[0]=gettok_char(&s, '=', FALSE);
|
||||
cstoken[1]=gettok_char(&s, '=', TRUE);
|
||||
cstoken[2]=gettok(&s);
|
||||
for (i=0; i<3;i++) {
|
||||
cwl = alloc(struct wordlist);
|
||||
cwl->wl_prev = wl;
|
||||
if (wl)
|
||||
wl->wl_next = cwl;
|
||||
else {
|
||||
wlist = cwl;
|
||||
cwl->wl_next = NULL;
|
||||
}
|
||||
cwl->wl_word = cstoken[i];
|
||||
wl = cwl;
|
||||
}
|
||||
com_let(wlist);
|
||||
wl_free(wlist);
|
||||
}
|
||||
}
|
||||
|
||||
/*merge the two option line structs*/
|
||||
if (!options && com_options)
|
||||
|
|
|
|||
Loading…
Reference in New Issue