mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 05:47:42 +02:00
rename variable typename --> type_name
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2011-05-01 Robert Larice
|
||||||
|
* src/spicelib/parser/inpdomod.c :
|
||||||
|
rename variable typename --> type_name
|
||||||
|
|
||||||
2011-05-01 Robert Larice
|
2011-05-01 Robert Larice
|
||||||
* src/xspice/cmpp/ifs_yacc.y :
|
* src/xspice/cmpp/ifs_yacc.y :
|
||||||
rename variable class --> ctype_class
|
rename variable class --> ctype_class
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
int type = -1;
|
int type = -1;
|
||||||
int lev, error1=0;
|
int lev, error1=0;
|
||||||
char ver[100];
|
char ver[100];
|
||||||
char *typename;
|
char *type_name;
|
||||||
char *err = NULL;
|
char *err = NULL;
|
||||||
char *line;
|
char *line;
|
||||||
char *val;
|
char *val;
|
||||||
@@ -40,10 +40,10 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
tfree(modname);
|
tfree(modname);
|
||||||
INPgetTok(&line, &modname, 1); /* get model name */
|
INPgetTok(&line, &modname, 1); /* get model name */
|
||||||
INPinsert(&modname, tab); /* stick model name into table */
|
INPinsert(&modname, tab); /* stick model name into table */
|
||||||
INPgetTok(&line, &typename, 1); /* get model type */
|
INPgetTok(&line, &type_name, 1); /* get model type */
|
||||||
|
|
||||||
/* ----- Check if model is a BJT --------- */
|
/* ----- Check if model is a BJT --------- */
|
||||||
if ((strcmp(typename, "npn") == 0) || (strcmp(typename, "pnp") == 0)) {
|
if ((strcmp(type_name, "npn") == 0) || (strcmp(type_name, "pnp") == 0)) {
|
||||||
err = INPfindLev(line,&lev);
|
err = INPfindLev(line,&lev);
|
||||||
switch(lev) {
|
switch(lev) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -95,7 +95,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
} /* end if ((strcmp(typename, "npn") == 0) || (strcmp(typename, "pnp") == 0)) */
|
} /* end if ((strcmp(typename, "npn") == 0) || (strcmp(typename, "pnp") == 0)) */
|
||||||
|
|
||||||
/* -------- Check if model is a diode --------- */
|
/* -------- Check if model is a diode --------- */
|
||||||
else if (strcmp(typename, "d") == 0) {
|
else if (strcmp(type_name, "d") == 0) {
|
||||||
type = INPtypelook("Diode");
|
type = INPtypelook("Diode");
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
err =
|
err =
|
||||||
@@ -106,8 +106,8 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
} /* else if (strcmp(typename, "d") == 0) { */
|
} /* else if (strcmp(typename, "d") == 0) { */
|
||||||
|
|
||||||
/* -------- Check if model is a jfet --------- */
|
/* -------- Check if model is a jfet --------- */
|
||||||
else if ((strcmp(typename, "njf") == 0)
|
else if ((strcmp(type_name, "njf") == 0)
|
||||||
|| (strcmp(typename, "pjf") == 0)) {
|
|| (strcmp(type_name, "pjf") == 0)) {
|
||||||
err = INPfindLev(line, &lev);
|
err = INPfindLev(line, &lev);
|
||||||
switch (lev) {
|
switch (lev) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -137,10 +137,10 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
} /* end else if ((strcmp(typename, "njf") == 0) */
|
} /* end else if ((strcmp(typename, "njf") == 0) */
|
||||||
|
|
||||||
/* -------- Check if model is a MES or an HFET --------- */
|
/* -------- Check if model is a MES or an HFET --------- */
|
||||||
else if ((strcmp(typename, "nmf") == 0)
|
else if ((strcmp(type_name, "nmf") == 0)
|
||||||
|| (strcmp(typename, "pmf") == 0)
|
|| (strcmp(type_name, "pmf") == 0)
|
||||||
|| (strcmp(typename, "nhfet") == 0)
|
|| (strcmp(type_name, "nhfet") == 0)
|
||||||
|| (strcmp(typename, "phfet") == 0)) {
|
|| (strcmp(type_name, "phfet") == 0)) {
|
||||||
err = INPfindLev( line, &lev );
|
err = INPfindLev( line, &lev );
|
||||||
switch ( lev )
|
switch ( lev )
|
||||||
{
|
{
|
||||||
@@ -196,7 +196,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------- Check if model is a Uniform Distrib. RC line --------- */
|
/* -------- Check if model is a Uniform Distrib. RC line --------- */
|
||||||
else if (strcmp(typename, "urc") == 0) {
|
else if (strcmp(type_name, "urc") == 0) {
|
||||||
type = INPtypelook("URC");
|
type = INPtypelook("URC");
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
err =
|
err =
|
||||||
@@ -207,10 +207,10 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------- Check if model is a MOSFET --------- */
|
/* -------- Check if model is a MOSFET --------- */
|
||||||
else if ((strcmp(typename, "nmos") == 0)
|
else if ((strcmp(type_name, "nmos") == 0)
|
||||||
|| (strcmp(typename, "pmos") == 0)
|
|| (strcmp(type_name, "pmos") == 0)
|
||||||
|| (strcmp(typename, "nsoi") == 0)
|
|| (strcmp(type_name, "nsoi") == 0)
|
||||||
|| (strcmp(typename, "psoi") == 0)) {
|
|| (strcmp(type_name, "psoi") == 0)) {
|
||||||
err = INPfindLev(line, &lev);
|
err = INPfindLev(line, &lev);
|
||||||
switch (lev) {
|
switch (lev) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -425,7 +425,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
}
|
}
|
||||||
#ifdef NDEV
|
#ifdef NDEV
|
||||||
/* -------- Check if model is a numerical device --------- */
|
/* -------- Check if model is a numerical device --------- */
|
||||||
else if (strcmp(typename, "ndev") == 0) {
|
else if (strcmp(type_name, "ndev") == 0) {
|
||||||
type = INPtypelook("NDEV");
|
type = INPtypelook("NDEV");
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
err =
|
err =
|
||||||
@@ -436,7 +436,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* -------- Check if model is a resistor --------- */
|
/* -------- Check if model is a resistor --------- */
|
||||||
else if (strcmp(typename, "r") == 0) {
|
else if (strcmp(type_name, "r") == 0) {
|
||||||
type = INPtypelook("Resistor");
|
type = INPtypelook("Resistor");
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
err =
|
err =
|
||||||
@@ -447,7 +447,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------- Check if model is a transmission line of some sort --------- */
|
/* -------- Check if model is a transmission line of some sort --------- */
|
||||||
else if(strcmp(typename,"txl") == 0) {
|
else if(strcmp(type_name,"txl") == 0) {
|
||||||
INPgetTok(&line,&val,1);
|
INPgetTok(&line,&val,1);
|
||||||
while (*line != '\0') {
|
while (*line != '\0') {
|
||||||
if (*val == 'R' || *val == 'r') {
|
if (*val == 'R' || *val == 'r') {
|
||||||
@@ -482,7 +482,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------- Check if model is a coupled transmission line --------- */
|
/* -------- Check if model is a coupled transmission line --------- */
|
||||||
else if(strcmp(typename,"cpl") == 0) {
|
else if(strcmp(type_name,"cpl") == 0) {
|
||||||
type = INPtypelook("CplLines");
|
type = INPtypelook("CplLines");
|
||||||
if(type < 0) {
|
if(type < 0) {
|
||||||
err = INPmkTemp(
|
err = INPmkTemp(
|
||||||
@@ -494,7 +494,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
|
|
||||||
|
|
||||||
/* -------- Check if model is a cap --------- */
|
/* -------- Check if model is a cap --------- */
|
||||||
else if (strcmp(typename, "c") == 0) {
|
else if (strcmp(type_name, "c") == 0) {
|
||||||
type = INPtypelook("Capacitor");
|
type = INPtypelook("Capacitor");
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
err =
|
err =
|
||||||
@@ -505,7 +505,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------- Check if model is an ind --------- */
|
/* -------- Check if model is an ind --------- */
|
||||||
else if (strcmp(typename, "l") == 0) {
|
else if (strcmp(type_name, "l") == 0) {
|
||||||
type = INPtypelook("Inductor");
|
type = INPtypelook("Inductor");
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
err =
|
err =
|
||||||
@@ -517,7 +517,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
|
|
||||||
|
|
||||||
/* -------- Check if model is a switch --------- */
|
/* -------- Check if model is a switch --------- */
|
||||||
else if (strcmp(typename, "sw") == 0) {
|
else if (strcmp(type_name, "sw") == 0) {
|
||||||
type = INPtypelook("Switch");
|
type = INPtypelook("Switch");
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
err =
|
err =
|
||||||
@@ -528,7 +528,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------- Check if model is a Current Controlled Switch --------- */
|
/* -------- Check if model is a Current Controlled Switch --------- */
|
||||||
else if (strcmp(typename, "csw") == 0) {
|
else if (strcmp(type_name, "csw") == 0) {
|
||||||
type = INPtypelook("CSwitch");
|
type = INPtypelook("CSwitch");
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
err =
|
err =
|
||||||
@@ -539,7 +539,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------- Check if model is a Lossy TransLine --------- */
|
/* -------- Check if model is a Lossy TransLine --------- */
|
||||||
else if (strcmp(typename, "ltra") == 0) {
|
else if (strcmp(type_name, "ltra") == 0) {
|
||||||
type = INPtypelook("LTRA");
|
type = INPtypelook("LTRA");
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
err =
|
err =
|
||||||
@@ -550,7 +550,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CIDER
|
#ifdef CIDER
|
||||||
else if(strcmp(typename,"numd") == 0) {
|
else if(strcmp(type_name,"numd") == 0) {
|
||||||
err = INPfindLev(line,&lev);
|
err = INPfindLev(line,&lev);
|
||||||
switch( lev ) {
|
switch( lev ) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -572,7 +572,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
INPmakeMod(modname,type,image);
|
INPmakeMod(modname,type,image);
|
||||||
} else if(strcmp(typename,"nbjt") == 0) {
|
} else if(strcmp(type_name,"nbjt") == 0) {
|
||||||
err = INPfindLev(line,&lev);
|
err = INPfindLev(line,&lev);
|
||||||
switch( lev ) {
|
switch( lev ) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -594,7 +594,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
INPmakeMod(modname,type,image);
|
INPmakeMod(modname,type,image);
|
||||||
} else if(strcmp(typename,"numos") == 0) {
|
} else if(strcmp(type_name,"numos") == 0) {
|
||||||
type = INPtypelook("NUMOS");
|
type = INPtypelook("NUMOS");
|
||||||
if(type < 0) {
|
if(type < 0) {
|
||||||
err =
|
err =
|
||||||
@@ -608,8 +608,8 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
/* type poly added by SDB . . . */
|
/* type poly added by SDB . . . */
|
||||||
#ifdef XSPICE
|
#ifdef XSPICE
|
||||||
/* -------- Check if model is a poly (specific to xspice) --------- */
|
/* -------- Check if model is a poly (specific to xspice) --------- */
|
||||||
else if ( (strcmp(typename, "poly") == 0) ||
|
else if ( (strcmp(type_name, "poly") == 0) ||
|
||||||
(strcmp(typename, "POLY") == 0) ) {
|
(strcmp(type_name, "POLY") == 0) ) {
|
||||||
type = INPtypelook("POLY");
|
type = INPtypelook("POLY");
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
err =
|
err =
|
||||||
@@ -624,30 +624,30 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
else {
|
else {
|
||||||
#ifndef XSPICE
|
#ifndef XSPICE
|
||||||
type = -1;
|
type = -1;
|
||||||
err = TMALLOC(char, 35 + strlen(typename));
|
err = TMALLOC(char, 35 + strlen(type_name));
|
||||||
(void) sprintf(err, "unknown model type %s - ignored\n", typename);
|
(void) sprintf(err, "unknown model type %s - ignored\n", type_name);
|
||||||
#else
|
#else
|
||||||
/* gtri - modify - wbk - 10/23/90 - modify to look for code models */
|
/* gtri - modify - wbk - 10/23/90 - modify to look for code models */
|
||||||
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
printf("In INPdomodel, found unknown model type, typename = %s . . .\n", typename);
|
printf("In INPdomodel, found unknown model type, typename = %s . . .\n", type_name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* look for this model type and put it in the table of models */
|
/* look for this model type and put it in the table of models */
|
||||||
type = INPtypelook(typename);
|
type = INPtypelook(type_name);
|
||||||
if(type < 0) {
|
if(type < 0) {
|
||||||
err = TMALLOC(char, 35 + strlen(typename));
|
err = TMALLOC(char, 35 + strlen(type_name));
|
||||||
sprintf(err,"Unknown model type %s - ignored\n",typename);
|
sprintf(err,"Unknown model type %s - ignored\n",type_name);
|
||||||
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
printf("In INPdomodel, ignoring unknown model typ typename = %s . . .\n", typename);
|
printf("In INPdomodel, ignoring unknown model typ typename = %s . . .\n", type_name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
printf("In INPdomodel, adding unknown model typename = %s to model list. . .\n", typename);
|
printf("In INPdomodel, adding unknown model typename = %s to model list. . .\n", type_name);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
INPmakeMod(modname,type,image);
|
INPmakeMod(modname,type,image);
|
||||||
@@ -657,6 +657,6 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
tfree(typename);
|
tfree(type_name);
|
||||||
return (err);
|
return (err);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user