Re: [ng-spice] Another patch for rework-11
*Sigh*
I hit the 'Send' button too fast... here's the patch.
--
Arno
Index: inp2dot.c
===================================================================
RCS file:
/var/services/cvsroot/ngspice/ng-spice-rework/src/circuit/inp2dot.c,v
retrieving revision 1.4
retrieving revision 1.6
diff -u -r1.4 -r1.6
--- inp2dot.c 2000/05/25 22:01:44 1.4
+++ inp2dot.c 2000/06/02 18:49:38 1.6
@@ -12,7 +12,8 @@
#include "inp.h"
static int
-dot_nodeset(void *ckt, INPtables *tab, card *current, void *task, void
*gnode)
+dot_nodeset(char *line, void *ckt, INPtables *tab, card *current,
+ void *task, void *gnode)
{
int which; /* which analysis we are performing */
int error; /* error code temporary */
@@ -21,11 +22,6 @@
IFvalue ptemp; /* a value structure to package resistance
into */
IFparm *prm; /* pointer to parameter to search through
array */
-
- /* the part of the current line left to parse */
- char *line = current->line;
-
-
/* .nodeset */
which = -1;
for (prm = ft_sim->nodeParms;
@@ -66,8 +62,8 @@
static int
-dot_noise(void *ckt, INPtables *tab, card *current, void *task, void *gnode,
- void *foo)
+dot_noise(char *line, void *ckt, INPtables *tab, card *current,
+ void *task, void *gnode, void *foo)
{
int which; /* which analysis we are performing */
int i; /* generic loop variable */
@@ -84,9 +80,6 @@
int found;
char *point;
- /* the part of the current line left to parse */
- char *line = current->line;
-
/* .noise V(OUTPUT,REF) SRC {DEC OCT LIN} NP FSTART FSTOP <PTSPRSUM> */
which = -1;
for (i = 0; i < ft_sim->numAnalyses; i++) {
@@ -116,7 +109,7 @@
ptemp.nValue = (IFnode) node1;
GCA(INPapName, (ckt, which, foo, "output", &ptemp))
- if (*line != /* match ( */ ')') {
+ if (*line != ')') {
INPgetTok(&line, &nname2, 1);
INPtermInsert(ckt, &nname2, tab, &node2);
ptemp.nValue = (IFnode) node2;
@@ -177,8 +170,8 @@
static int
-dot_op(void *ckt, INPtables *tab, card *current, void *task, void *gnode,
- void *foo)
+dot_op(char *line, void *ckt, INPtables *tab, card *current,
+ void *task, void *gnode, void *foo)
{
int which; /* which analysis we are performing */
int i; /* generic loop variable */
@@ -202,8 +195,8 @@
static int
-dot_disto(void *ckt, INPtables *tab, card *current, void *task, void *gnode,
- void *foo)
+dot_disto(char *line, void *ckt, INPtables *tab, card *current,
+ void *task, void *gnode, void *foo)
{
int which; /* which analysis we are performing */
int i; /* generic loop variable */
@@ -212,10 +205,6 @@
IFvalue *parm; /* a pointer to a value struct for function
returns */
char *steptype; /* ac analysis, type of stepping function */
-
- /* the part of the current line left to parse */
- char *line = current->line;
-
/* .disto {DEC OCT LIN} NP FSTART FSTOP <F2OVERF1> */
which = -1;
for (i = 0; i < ft_sim->numAnalyses; i++) {
@@ -247,8 +236,8 @@
static int
-dot_ic(void *ckt, INPtables *tab, card *current, void *task, void *gnode,
- void *foo)
+dot_ic(char *line, void *ckt, INPtables *tab, card *current,
+ void *task, void *gnode, void *foo)
{
int which; /* which analysis we are performing */
int error; /* error code temporary */
@@ -256,10 +245,6 @@
IFparm *prm; /* pointer to parameter to search through
array */
void *node1; /* the first node's node pointer */
-
- /* the part of the current line left to parse */
- char *line = current->line;
-
/* .ic */
which = -1;
for (prm = ft_sim->nodeParms;
@@ -273,7 +258,8 @@
LITERR("ic unknown to simulator. \n");
return (0);
}
- for (;;) { /* loop until we run out of data */
+ for (;;) {
+ /* loop until we run out of data */
int length;
char *name; /* the resistor's name */
@@ -299,8 +285,8 @@
static int
-dot_ac(void *ckt, INPtables *tab, card *current, void *task, void *gnode,
- void *foo)
+dot_ac(char *line, void *ckt, INPtables *tab, card *current,
+ void *task, void *gnode, void *foo)
{
int error; /* error code temporary */
IFvalue ptemp; /* a value structure to package resistance
into */
@@ -309,9 +295,6 @@
int i; /* generic loop variable */
char *steptype; /* ac analysis, type of stepping function */
- /* the part of the current line left to parse */
- char *line = current->line;
-
/* .ac {DEC OCT LIN} NP FSTART FSTOP */
which = -1;
for (i = 0; i < ft_sim->numAnalyses; i++) {
@@ -338,8 +321,8 @@
}
static int
-dot_pz(void *ckt, INPtables *tab, card *current, void *task, void *gnode,
- void *foo)
+dot_pz(char *line, void *ckt, INPtables *tab, card *current,
+ void *task, void *gnode, void *foo)
{
int error; /* error code temporary */
IFvalue ptemp; /* a value structure to package resistance
into */
@@ -348,9 +331,6 @@
int i; /* generic loop variable */
char *steptype; /* ac analysis, type of stepping function */
- /* the part of the current line left to parse */
- char *line = current->line;
-
/* .pz nodeI nodeG nodeJ nodeK {V I} {POL ZER PZ} */
which = -1;
for (i = 0; i < ft_sim->numAnalyses; i++) {
@@ -383,8 +363,8 @@
static int
-dot_dc(void *ckt, INPtables *tab, card *current, void *task, void *gnode,
- void *foo)
+dot_dc(char *line, void *ckt, INPtables *tab, card *current,
+ void *task, void *gnode, void *foo)
{
char *name; /* the resistor's name */
int error; /* error code temporary */
@@ -393,9 +373,6 @@
int which; /* which analysis we are performing */
int i; /* generic loop variable */
- /* the part of the current line left to parse */
- char *line = current->line;
-
/* .dc SRC1NAME Vstart1 Vstop1 Vinc1 [SRC2NAME Vstart2 */
/* Vstop2 Vinc2 */
which = -1;
@@ -477,13 +454,13 @@
LITERR(" Warning: .TEMP card obsolete - use .options TEMP and
TNOM\n");
return (0);
} else if ((strcmp(token, ".op") == 0)) {
- return dot_op(ckt, tab, current, task, gnode, foo);
+ return dot_op(line, ckt, tab, current, task, gnode, foo);
} else if ((strcmp(token, ".nodeset") == 0)) {
- return dot_nodeset(ckt, tab, current, task, gnode);
+ return dot_nodeset(line, ckt, tab, current, task, gnode);
} else if ((strcmp(token, ".disto") == 0)) {
- return dot_disto(ckt, tab, current, task, gnode, foo);
+ return dot_disto(line, ckt, tab, current, task, gnode, foo);
} else if ((strcmp(token, ".noise") == 0)) {
- return dot_noise(ckt, tab, current, task, gnode, foo);
+ return dot_noise(line, ckt, tab, current, task, gnode, foo);
} else if ((strcmp(token, ".four") == 0)
|| (strcmp(token, ".fourier") == 0)) {
/* .four */
@@ -491,13 +468,13 @@
LITERR("Use fourier command to obtain fourier analysis\n");
return (0);
} else if ((strcmp(token, ".ic") == 0)) {
- return dot_ic(ckt, tab, current, task, gnode, foo);
+ return dot_ic(line, ckt, tab, current, task, gnode, foo);
} else if ((strcmp(token, ".ac") == 0)) {
- return dot_ac(ckt, tab, current, task, gnode, foo);
+ return dot_ac(line, ckt, tab, current, task, gnode, foo);
} else if ((strcmp(token, ".pz") == 0)) {
- return dot_pz(ckt, tab, current, task, gnode, foo);
+ return dot_pz(line, ckt, tab, current, task, gnode, foo);
} else if ((strcmp(token, ".dc") == 0)) {
- return dot_dc(ckt, tab, current, task, gnode, foo);
+ return dot_dc(line, ckt, tab, current, task, gnode, foo);
} else if ((strcmp(token, ".tf") == 0)) {
/* .tf v( node1, node2 ) src */
/* .tf vsrc2 src */
PGP signature
Partial thread listing: