.probe: Add call to function inp_probe() which resides
in inpc_probe.c. Make function insert_new_line() non-static Enable detecting the number of nodes in x-lines (calls to subciruits) in function get_number_terminals()
This commit is contained in:
parent
7f1a3bea20
commit
9dff15507d
|
|
@ -190,6 +190,7 @@ static char* eval_tc(char* line, char* tline);
|
|||
|
||||
static void rem_double_braces(struct card* card);
|
||||
|
||||
extern void inp_probe(struct card* card);
|
||||
#ifndef EXT_ASC
|
||||
static void utf8_syntax_check(struct card *deck);
|
||||
#endif
|
||||
|
|
@ -402,7 +403,7 @@ static int is_cider_model(char *buf)
|
|||
#endif
|
||||
|
||||
/* insert a new card, just behind the given card */
|
||||
static struct card *insert_new_line(
|
||||
struct card *insert_new_line(
|
||||
struct card *card, char *line, int linenum, int linenum_orig)
|
||||
{
|
||||
struct card *x = TMALLOC(struct card, 1);
|
||||
|
|
@ -1024,6 +1025,8 @@ struct card *inp_readall(FILE *fp, const char *dir_name,
|
|||
|
||||
struct nscope *root = inp_add_levels(working);
|
||||
|
||||
inp_probe(working);
|
||||
|
||||
inp_fix_for_numparam(subckt_w_params, working);
|
||||
|
||||
inp_remove_excess_ws(working);
|
||||
|
|
@ -4583,6 +4586,19 @@ int get_number_terminals(char *c)
|
|||
}
|
||||
return i - 2;
|
||||
break;
|
||||
case 'x':
|
||||
i = 0;
|
||||
/* find the first token with "params:" or "=" in the line*/
|
||||
while ((i < 100) && (*c != '\0')) {
|
||||
char *inst = gettok_instance(&c);
|
||||
strncpy(nam_buf, inst, sizeof(nam_buf) - 1);
|
||||
txfree(inst);
|
||||
if (strstr(nam_buf, "params") || strchr(nam_buf, '='))
|
||||
break;
|
||||
i++;
|
||||
}
|
||||
return i - 2;
|
||||
break;
|
||||
case 'u':
|
||||
case 'j':
|
||||
case 'w':
|
||||
|
|
|
|||
Loading…
Reference in New Issue