Browse Source

outitf.c, whitespace

rlar 14 years ago
parent
commit
486ffc9429
  1. 134
      src/frontend/outitf.c

134
src/frontend/outitf.c

@ -89,7 +89,6 @@ OUTpBeginPlot(CKTcircuit *circuitPtr, JOB *analysisPtr,
if (ARCHme != 0) return(OK); if (ARCHme != 0) return(OK);
#endif /* PARALLEL_ARCH */ #endif /* PARALLEL_ARCH */
if (ft_curckt->ci_ckt == circuitPtr) if (ft_curckt->ci_ckt == circuitPtr)
name = ft_curckt->ci_name; name = ft_curckt->ci_name;
else else
@ -101,12 +100,14 @@ OUTpBeginPlot(CKTcircuit *circuitPtr, JOB *analysisPtr,
plotPtr)); plotPtr));
} }
int int
OUTwBeginPlot(CKTcircuit *circuitPtr, JOB *analysisPtr, OUTwBeginPlot(CKTcircuit *circuitPtr, JOB *analysisPtr,
IFuid analName, IFuid analName,
IFuid refName, int refType, IFuid refName, int refType,
int numNames, IFuid *dataNames, int dataType, runDesc **plotPtr) int numNames, IFuid *dataNames, int dataType, runDesc **plotPtr)
{ {
#ifdef PARALLEL_ARCH #ifdef PARALLEL_ARCH
if (ARCHme != 0) return(OK); if (ARCHme != 0) return(OK);
#endif /* PARALLEL_ARCH */ #endif /* PARALLEL_ARCH */
@ -117,6 +118,7 @@ OUTwBeginPlot(CKTcircuit *circuitPtr, JOB *analysisPtr,
plotPtr)); plotPtr));
} }
static int static int
beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analName, char *refName, int refType, int numNames, char **dataNames, int dataType, bool windowed, runDesc **runp) beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analName, char *refName, int refType, int numNames, char **dataNames, int dataType, bool windowed, runDesc **runp)
{ {
@ -243,7 +245,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
nodes, and saves the terminal currents instead */ nodes, and saves the terminal currents instead */
if (savealli) { if (savealli) {
depind=0;
depind = 0;
for (i = 0; i < numNames; i++) { for (i = 0; i < numNames; i++) {
if (strstr(dataNames[i], "#internal") || if (strstr(dataNames[i], "#internal") ||
strstr(dataNames[i], "#source") || strstr(dataNames[i], "#source") ||
@ -251,10 +253,10 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
strstr(dataNames[i], "#collector") || strstr(dataNames[i], "#collector") ||
strstr(dataNames[i], "#emitter") || strstr(dataNames[i], "#emitter") ||
strstr(dataNames[i], "#base")) { strstr(dataNames[i], "#base")) {
tmpname[0]='@';
tmpname[1]='\0';
tmpname[0] = '@';
tmpname[1] = '\0';
strncat(tmpname, dataNames[i], BSIZE_SP-1); strncat(tmpname, dataNames[i], BSIZE_SP-1);
ch=strchr(tmpname, '#');
ch = strchr(tmpname, '#');
if (strstr(ch, "#collector")!=NULL) { if (strstr(ch, "#collector")!=NULL) {
strcpy(ch, "[ic]"); strcpy(ch, "[ic]");
@ -300,14 +302,17 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
/* Pass 2. */ /* Pass 2. */
for (i = 0; i < numsaves; i++) { for (i = 0; i < numsaves; i++) {
if (savesused[i]) if (savesused[i])
continue; continue;
if (!parseSpecial(saves[i].name, namebuf, parambuf, depbuf)) { if (!parseSpecial(saves[i].name, namebuf, parambuf, depbuf)) {
if (saves[i].analysis) if (saves[i].analysis)
fprintf(cp_err, "Warning: can't parse '%s': ignored\n", fprintf(cp_err, "Warning: can't parse '%s': ignored\n",
saves[i].name); saves[i].name);
continue; continue;
} }
/* Now, if there's a dep variable, do we already have it? */ /* Now, if there's a dep variable, do we already have it? */
if (*depbuf) { if (*depbuf) {
for (j = 0; j < run->numData; j++) for (j = 0; j < run->numData; j++)
@ -330,7 +335,8 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
depind = j; depind = j;
} else } else
depind = run->data[j].outIndex; depind = run->data[j].outIndex;
}
}
addSpecialDesc(run, saves[i].name, namebuf, parambuf, depind); addSpecialDesc(run, saves[i].name, namebuf, parambuf, depind);
} }
@ -364,13 +370,16 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
run->runPlot->pl_ndims = 1; run->runPlot->pl_ndims = 1;
} }
} }
/*Start BLT, initilises the blt vectors saj*/ /*Start BLT, initilises the blt vectors saj*/
#ifdef TCL_MODULE #ifdef TCL_MODULE
blt_init(run); blt_init(run);
#endif #endif
return (OK); return (OK);
} }
static int static int
addDataDesc(runDesc *run, char *name, int type, int ind) addDataDesc(runDesc *run, char *name, int type, int ind)
{ {
@ -380,6 +389,7 @@ addDataDesc(runDesc *run, char *name, int type, int ind)
run->data = TMALLOC(dataDesc, 1); run->data = TMALLOC(dataDesc, 1);
else else
run->data = TREALLOC(dataDesc, run->data, run->numData + 1); run->data = TREALLOC(dataDesc, run->data, run->numData + 1);
data = &run->data[run->numData]; data = &run->data[run->numData];
/* so freeRun will get nice NULL pointers for the fields we don't set */ /* so freeRun will get nice NULL pointers for the fields we don't set */
bzero(data, sizeof(dataDesc)); bzero(data, sizeof(dataDesc));
@ -391,7 +401,7 @@ addDataDesc(runDesc *run, char *name, int type, int ind)
data->outIndex = ind; data->outIndex = ind;
if (ind == -1) { if (ind == -1) {
/* It's the reference vector. */
/* It's the reference vector. */
run->refIndex = run->numData; run->refIndex = run->numData;
} }
@ -400,6 +410,7 @@ addDataDesc(runDesc *run, char *name, int type, int ind)
return (OK); return (OK);
} }
static int static int
addSpecialDesc(runDesc *run, char *name, char *devname, char *param, int depind) addSpecialDesc(runDesc *run, char *name, char *devname, char *param, int depind)
{ {
@ -410,6 +421,7 @@ addSpecialDesc(runDesc *run, char *name, char *devname, char *param, int depind)
run->data = TMALLOC(dataDesc, 1); run->data = TMALLOC(dataDesc, 1);
else else
run->data = TREALLOC(dataDesc, run->data, run->numData + 1); run->data = TREALLOC(dataDesc, run->data, run->numData + 1);
data = &run->data[run->numData]; data = &run->data[run->numData];
/* so freeRun will get nice NULL pointers for the fields we don't set */ /* so freeRun will get nice NULL pointers for the fields we don't set */
bzero(data, sizeof(dataDesc)); bzero(data, sizeof(dataDesc));
@ -435,25 +447,28 @@ addSpecialDesc(runDesc *run, char *name, char *devname, char *param, int depind)
} }
int int
OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr) OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
{ {
runDesc *run = plotPtr; // FIXME runDesc *run = plotPtr; // FIXME
IFvalue val; IFvalue val;
int i; int i;
#ifdef PARALLEL_ARCH #ifdef PARALLEL_ARCH
if (ARCHme != 0) return(OK); if (ARCHme != 0) return(OK);
#endif /* PARALLEL_ARCH */ #endif /* PARALLEL_ARCH */
run->pointCount++; run->pointCount++;
#ifdef TCL_MODULE #ifdef TCL_MODULE
steps_completed = run->pointCount; steps_completed = run->pointCount;
#endif #endif
if (run->writeOut) { if (run->writeOut) {
if (run->pointCount == 1) if (run->pointCount == 1)
fileInit_pass2(run); fileInit_pass2(run);
fileStartPoint(run->fp, run->binary, run->pointCount); fileStartPoint(run->fp, run->binary, run->pointCount);
if (run->refIndex != -1) { if (run->refIndex != -1) {
@ -465,7 +480,7 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
too much CPU time */ too much CPU time */
#ifndef HAS_WINDOWS #ifndef HAS_WINDOWS
currclock = clock(); currclock = clock();
if ((currclock-lastclock)>(0.25*CLOCKS_PER_SEC)) {
if ((currclock-lastclock) > (0.25*CLOCKS_PER_SEC)) {
fprintf(stderr, " Reference value : % 12.5e\r", fprintf(stderr, " Reference value : % 12.5e\r",
refValue->cValue.real); refValue->cValue.real);
lastclock = currclock; lastclock = currclock;
@ -478,16 +493,18 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
fileAddRealValue(run->fp, run->binary, refValue->rValue); fileAddRealValue(run->fp, run->binary, refValue->rValue);
#ifndef HAS_WINDOWS #ifndef HAS_WINDOWS
currclock = clock(); currclock = clock();
if ((currclock-lastclock)>(0.25*CLOCKS_PER_SEC)) {
if ((currclock-lastclock) > (0.25*CLOCKS_PER_SEC)) {
fprintf(stderr, " Reference value : % 12.5e\r", refValue->rValue); fprintf(stderr, " Reference value : % 12.5e\r", refValue->rValue);
lastclock = currclock; lastclock = currclock;
} }
#endif #endif
} }
} }
for (i = 0; i < run->numData; i++) { for (i = 0; i < run->numData; i++) {
/* we've already printed reference vec first */ /* we've already printed reference vec first */
if (run->data[i].outIndex == -1) continue; if (run->data[i].outIndex == -1) continue;
#ifdef TCL_MODULE #ifdef TCL_MODULE
blt_add(i, refValue ? refValue->rValue : NAN); blt_add(i, refValue ? refValue->rValue : NAN);
#endif #endif
@ -510,22 +527,24 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
/* If this is the first data point, print a warning for any unrecognized /* If this is the first data point, print a warning for any unrecognized
variables, since this has not already been checked */ variables, since this has not already been checked */
if (run->pointCount==1)
if (run->pointCount == 1)
fprintf(stderr, "Warning: unrecognized variable - %s\n", fprintf(stderr, "Warning: unrecognized variable - %s\n",
run->data[i].name); run->data[i].name);
if (run->isComplex) { if (run->isComplex) {
val.cValue.real=0;
val.cValue.imag=0;
val.cValue.real = 0;
val.cValue.imag = 0;
fileAddComplexValue(run->fp, run->binary, fileAddComplexValue(run->fp, run->binary,
val.cValue); val.cValue);
} else { } else {
val.rValue=0;
val.rValue = 0;
fileAddRealValue(run->fp, run->binary, fileAddRealValue(run->fp, run->binary,
val.rValue); val.rValue);
}; };
continue; continue;
}; };
if (run->data[i].type == IF_REAL) if (run->data[i].type == IF_REAL)
fileAddRealValue(run->fp, run->binary, fileAddRealValue(run->fp, run->binary,
val.rValue); val.rValue);
@ -535,11 +554,14 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
else else
fprintf(stderr, "OUTpData: unsupported data type\n"); fprintf(stderr, "OUTpData: unsupported data type\n");
} }
#ifdef TCL_MODULE #ifdef TCL_MODULE
blt_add(i,valuePtr->v.vec.rVec blt_add(i,valuePtr->v.vec.rVec
[run->data[i].outIndex]); [run->data[i].outIndex]);
#endif #endif
} }
fileEndPoint(run->fp, run->binary); fileEndPoint(run->fp, run->binary);
/* Check that the write to disk completed successfully, otherwise abort */ /* Check that the write to disk completed successfully, otherwise abort */
@ -548,14 +570,16 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
fprintf(stderr, "Warning: rawfile write error !!\n"); fprintf(stderr, "Warning: rawfile write error !!\n");
shouldstop = TRUE; shouldstop = TRUE;
}; };
} else { } else {
/* This is interactive mode. Update the screen with the reference /* This is interactive mode. Update the screen with the reference
variable just the same */ variable just the same */
currclock = clock(); currclock = clock();
#ifndef HAS_WINDOWS #ifndef HAS_WINDOWS
if ((currclock-lastclock)>(0.25*CLOCKS_PER_SEC)) {
if ((currclock-lastclock) > (0.25*CLOCKS_PER_SEC)) {
if (run->isComplex) { if (run->isComplex) {
fprintf(stderr, " Reference value : % 12.5e\r", fprintf(stderr, " Reference value : % 12.5e\r",
refValue ? refValue->cValue.real : NAN); refValue ? refValue->cValue.real : NAN);
@ -566,11 +590,14 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
lastclock = currclock; lastclock = currclock;
} }
#endif #endif
for (i = 0; i < run->numData; i++) { for (i = 0; i < run->numData; i++) {
#ifdef TCL_MODULE #ifdef TCL_MODULE
/*Locks the blt vector to stop access*/ /*Locks the blt vector to stop access*/
blt_lockvec(i); blt_lockvec(i);
#endif #endif
if (run->data[i].outIndex == -1) { if (run->data[i].outIndex == -1) {
if (run->data[i].type == IF_REAL) if (run->data[i].type == IF_REAL)
plotAddRealValue(&run->data[i], refValue->rValue); plotAddRealValue(&run->data[i], refValue->rValue);
@ -594,11 +621,14 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
else else
fprintf(stderr, "OUTpData: unsupported data type\n"); fprintf(stderr, "OUTpData: unsupported data type\n");
} }
#ifdef TCL_MODULE #ifdef TCL_MODULE
/*relinks and unlocks vector*/ /*relinks and unlocks vector*/
blt_relink(i,(run->data[i]).vec);
blt_relink(i, (run->data[i]).vec);
#endif #endif
} }
gr_iplot(run->runPlot); gr_iplot(run->runPlot);
} }
@ -609,7 +639,6 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
Tcl_ExecutePerLoop(); Tcl_ExecutePerLoop();
#endif #endif
return (OK); return (OK);
} }
@ -624,6 +653,8 @@ OUTwReference(void *plotPtr, IFvalue *valuePtr, void **refPtr)
return (OK); return (OK);
} }
/* ARGSUSED */ /* until some code gets written */ /* ARGSUSED */ /* until some code gets written */
int int
OUTwData(runDesc *plotPtr, int dataIndex, IFvalue *valuePtr, void *refPtr) OUTwData(runDesc *plotPtr, int dataIndex, IFvalue *valuePtr, void *refPtr)
@ -636,16 +667,17 @@ OUTwData(runDesc *plotPtr, int dataIndex, IFvalue *valuePtr, void *refPtr)
return (OK); return (OK);
} }
/* ARGSUSED */ /* until some code gets written */ /* ARGSUSED */ /* until some code gets written */
int int
OUTwEnd(runDesc *plotPtr) OUTwEnd(runDesc *plotPtr)
{ {
NG_IGNORE(plotPtr); NG_IGNORE(plotPtr);
return (OK); return (OK);
} }
int int
OUTendPlot(runDesc *plotPtr) OUTendPlot(runDesc *plotPtr)
{ {
@ -668,7 +700,6 @@ OUTendPlot(runDesc *plotPtr)
} }
/* ARGSUSED */ /* until some code gets written */ /* ARGSUSED */ /* until some code gets written */
int int
OUTbeginDomain(runDesc *plotPtr, IFuid refName, int refType, IFvalue *outerRefValue) OUTbeginDomain(runDesc *plotPtr, IFuid refName, int refType, IFvalue *outerRefValue)
@ -681,16 +712,17 @@ OUTbeginDomain(runDesc *plotPtr, IFuid refName, int refType, IFvalue *outerRefVa
return (OK); return (OK);
} }
/* ARGSUSED */ /* until some code gets written */ /* ARGSUSED */ /* until some code gets written */
int int
OUTendDomain(runDesc *plotPtr) OUTendDomain(runDesc *plotPtr)
{ {
NG_IGNORE(plotPtr); NG_IGNORE(plotPtr);
return (OK); return (OK);
} }
/* ARGSUSED */ /* until some code gets written */ /* ARGSUSED */ /* until some code gets written */
int int
OUTattributes(runDesc *plotPtr, IFuid varName, int param, IFvalue *value) OUTattributes(runDesc *plotPtr, IFuid varName, int param, IFvalue *value)
@ -731,7 +763,6 @@ OUTattributes(runDesc *plotPtr, IFuid varName, int param, IFvalue *value)
} }
/* The file writing routines. */ /* The file writing routines. */
static void static void
@ -782,6 +813,7 @@ fileInit(runDesc *run)
return; return;
} }
static void static void
fileInit_pass2(runDesc *run) fileInit_pass2(runDesc *run)
{ {
@ -819,14 +851,15 @@ fileInit_pass2(runDesc *run)
} else { } else {
fprintf(run->fp, "\t%d\t%s\t%s", i, name, ft_typenames(type)); fprintf(run->fp, "\t%d\t%s\t%s", i, name, ft_typenames(type));
} }
if (run->data[i].gtype == GRID_XLOG) if (run->data[i].gtype == GRID_XLOG)
fprintf(run->fp, "\tgrid=3"); fprintf(run->fp, "\tgrid=3");
fprintf(run->fp, "\n"); fprintf(run->fp, "\n");
} }
fprintf(run->fp, "%s:\n", run->binary ? "Binary" : "Values"); fprintf(run->fp, "%s:\n", run->binary ? "Binary" : "Values");
fflush(run->fp); /* Make all sure this gets to disk */ fflush(run->fp); /* Make all sure this gets to disk */
/* Allocate Row buffer */ /* Allocate Row buffer */
@ -842,6 +875,7 @@ fileInit_pass2(runDesc *run)
} }
static void static void
fileStartPoint(FILE *fp, bool bin, int num) fileStartPoint(FILE *fp, bool bin, int num)
{ {
@ -855,42 +889,44 @@ fileStartPoint(FILE *fp, bool bin, int num)
return; return;
} }
static void static void
fileAddRealValue(FILE *fp, bool bin, double value) fileAddRealValue(FILE *fp, bool bin, double value)
{ {
if (bin) if (bin)
rowbuf[column++]=value;
rowbuf[column++] = value;
else else
fprintf(fp, "\t%.*e\n", DOUBLE_PRECISION, value); fprintf(fp, "\t%.*e\n", DOUBLE_PRECISION, value);
return; return;
} }
static void static void
fileAddComplexValue(FILE *fp, bool bin, IFcomplex value) fileAddComplexValue(FILE *fp, bool bin, IFcomplex value)
{ {
if (bin) { if (bin) {
rowbuf[column++]=value.real;
rowbuf[column++]=value.imag;
rowbuf[column++] = value.real;
rowbuf[column++] = value.imag;
} else { } else {
fprintf(fp, "\t%.*e,%.*e\n", DOUBLE_PRECISION, value.real, fprintf(fp, "\t%.*e,%.*e\n", DOUBLE_PRECISION, value.real,
DOUBLE_PRECISION, value.imag); DOUBLE_PRECISION, value.imag);
} }
} }
/* ARGSUSED */ /* until some code gets written */ /* ARGSUSED */ /* until some code gets written */
static void static void
fileEndPoint(FILE *fp, bool bin) fileEndPoint(FILE *fp, bool bin)
{ {
if (bin) { if (bin) {
/* write row buffer to file */
/* write row buffer to file */
fwrite(rowbuf, sizeof(double), rowbuflen, fp); fwrite(rowbuf, sizeof(double), rowbuflen, fp);
}; /* otherwise the data has already been written */ }; /* otherwise the data has already been written */
return; return;
} }
/* Here's the hack... Run back and fill in the number of points. */ /* Here's the hack... Run back and fill in the number of points. */
static void static void
@ -908,6 +944,7 @@ fileEnd(runDesc *run)
/* Yet another hack-around */ /* Yet another hack-around */
fprintf(stderr, "@@@ %ld %d\n", run->pointPos, run->pointCount); fprintf(stderr, "@@@ %ld %d\n", run->pointPos, run->pointCount);
} }
fflush(run->fp); fflush(run->fp);
if (run->binary) { if (run->binary) {
@ -919,7 +956,6 @@ fileEnd(runDesc *run)
} }
/* The plot maintenance routines. */ /* The plot maintenance routines. */
static void static void
@ -933,7 +969,7 @@ plotInit(runDesc *run)
pl->pl_title = copy(run->name); pl->pl_title = copy(run->name);
pl->pl_name = copy(run->type); pl->pl_name = copy(run->type);
pl->pl_date = copy(datestring( ));
pl->pl_date = copy(datestring());
pl->pl_ndims = 0; pl->pl_ndims = 0;
plot_new(pl); plot_new(pl);
plot_setcur(pl->pl_typename); plot_setcur(pl->pl_typename);
@ -993,6 +1029,7 @@ plotInit(runDesc *run)
} }
} }
static void static void
plotAddRealValue(dataDesc *desc, double value) plotAddRealValue(dataDesc *desc, double value)
{ {
@ -1010,11 +1047,12 @@ plotAddRealValue(dataDesc *desc, double value)
v->v_compdata[v->v_length].cx_imag = 0.0; v->v_compdata[v->v_length].cx_imag = 0.0;
} }
v->v_length++; v->v_length++;
v->v_dims[0]=v->v_length; /* va, must be updated */
v->v_dims[0] = v->v_length; /* va, must be updated */
return; return;
} }
static void static void
plotAddComplexValue(dataDesc *desc, IFcomplex value) plotAddComplexValue(dataDesc *desc, IFcomplex value)
{ {
@ -1025,22 +1063,22 @@ plotAddComplexValue(dataDesc *desc, IFcomplex value)
v->v_compdata[v->v_length].cx_real = value.real; v->v_compdata[v->v_length].cx_real = value.real;
v->v_compdata[v->v_length].cx_imag = value.imag; v->v_compdata[v->v_length].cx_imag = value.imag;
v->v_length++; v->v_length++;
v->v_dims[0]=v->v_length; /* va, must be updated */
v->v_dims[0] = v->v_length; /* va, must be updated */
return; return;
} }
/* ARGSUSED */ /* until some code gets written */ /* ARGSUSED */ /* until some code gets written */
static void static void
plotEnd(runDesc *run) plotEnd(runDesc *run)
{ {
fprintf(stderr,"\n");
fprintf(stderr, "\n");
fprintf(stdout, "\nNo. of Data Rows : %d\n", run->pointCount); fprintf(stdout, "\nNo. of Data Rows : %d\n", run->pointCount);
return; return;
} }
/* ParseSpecial takes something of the form "@name[param,index]" and rips /* ParseSpecial takes something of the form "@name[param,index]" and rips
* out name, param, andstrchr. * out name, param, andstrchr.
*/ */
@ -1084,6 +1122,7 @@ parseSpecial(char *name, char *dev, char *param, char *ind)
return FALSE; return FALSE;
} }
/* This routine must match two names with or without a V() around them. */ /* This routine must match two names with or without a V() around them. */
static bool static bool
@ -1091,16 +1130,17 @@ name_eq(char *n1, char *n2)
{ {
char buf1[BSIZE_SP], buf2[BSIZE_SP], *s; char buf1[BSIZE_SP], buf2[BSIZE_SP], *s;
if ((s =strchr(n1, '(')) != NULL) {
if ((s = strchr(n1, '(')) != NULL) {
strcpy(buf1, s); strcpy(buf1, s);
if ((s =strchr(buf1, ')')) == NULL)
if ((s = strchr(buf1, ')')) == NULL)
return FALSE; return FALSE;
*s = '\0'; *s = '\0';
n1 = buf1; n1 = buf1;
} }
if ((s =strchr(n2, '(')) != NULL) {
if ((s = strchr(n2, '(')) != NULL) {
strcpy(buf2, s); strcpy(buf2, s);
if ((s =strchr(buf2, ')')) == NULL)
if ((s = strchr(buf2, ')')) == NULL)
return FALSE; return FALSE;
*s = '\0'; *s = '\0';
n2 = buf2; n2 = buf2;
@ -1109,6 +1149,7 @@ name_eq(char *n1, char *n2)
return (strcmp(n1, n2) ? FALSE : TRUE); return (strcmp(n1, n2) ? FALSE : TRUE);
} }
static bool static bool
getSpecial(dataDesc *desc, runDesc *run, IFvalue *val) getSpecial(dataDesc *desc, runDesc *run, IFvalue *val)
{ {
@ -1140,36 +1181,39 @@ getSpecial(dataDesc *desc, runDesc *run, IFvalue *val)
return FALSE; return FALSE;
} }
static void static void
freeRun(runDesc *run) freeRun(runDesc *run)
{ {
int i; int i;
for (i=0; i < run->numData; i++) {
for (i = 0; i < run->numData; i++) {
tfree(run->data[i].name); tfree(run->data[i].name);
tfree(run->data[i].specParamName); tfree(run->data[i].specParamName);
} }
tfree(run->data); tfree(run->data);
tfree(run->type); tfree(run->type);
tfree(run->name); tfree(run->name);
tfree(run); tfree(run);
} }
int int
OUTstopnow(void) OUTstopnow(void)
{ {
if (ft_intrpt || shouldstop) { if (ft_intrpt || shouldstop) {
ft_intrpt = shouldstop = FALSE; ft_intrpt = shouldstop = FALSE;
return (1); return (1);
} else } else
return (0);
return (0);
} }
/* Print out error messages. */ /* Print out error messages. */
static struct mesg { static struct mesg {
@ -1181,12 +1225,12 @@ static struct mesg {
{ "Panic", ERR_PANIC } , { "Panic", ERR_PANIC } ,
{ "Note", ERR_INFO } , { "Note", ERR_INFO } ,
{ NULL, 0 } { NULL, 0 }
} ;
};
void void
OUTerror(int flags, char *format, IFuid *names) OUTerror(int flags, char *format, IFuid *names)
{ {
struct mesg *m; struct mesg *m;
char buf[BSIZE_SP], *s, *bptr; char buf[BSIZE_SP], *s, *bptr;
int nindex = 0; int nindex = 0;
@ -1211,8 +1255,8 @@ OUTerror(int flags, char *format, IFuid *names)
*bptr++ = *s; *bptr++ = *s;
} }
} }
*bptr = '\0'; *bptr = '\0';
fprintf(cp_err, "%s\n", buf); fprintf(cp_err, "%s\n", buf);
fflush(cp_err); fflush(cp_err);
} }
Loading…
Cancel
Save