rewrite INPlookMod(), return INPmodel*/NULL instead of int 1/0
This commit is contained in:
parent
f285dd0aa8
commit
a716572233
|
|
@ -1,3 +1,8 @@
|
||||||
|
2012-02-06 Robert Larice
|
||||||
|
* src/include/ngspice/inpdefs.h ,
|
||||||
|
* src/spicelib/parser/inplkmod.c :
|
||||||
|
rewrite INPlookMod(), return INPmodel*/NULL instead of int 1/0
|
||||||
|
|
||||||
2012-02-06 Robert Larice
|
2012-02-06 Robert Larice
|
||||||
* src/frontend/com_compose.c ,
|
* src/frontend/com_compose.c ,
|
||||||
* src/frontend/define.c ,
|
* src/frontend/define.c ,
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ int INPinsertNofree(char **token, INPtables *tab);
|
||||||
int INPinsert(char **, INPtables *);
|
int INPinsert(char **, INPtables *);
|
||||||
int INPretrieve(char **, INPtables *);
|
int INPretrieve(char **, INPtables *);
|
||||||
int INPremove(char *, INPtables *);
|
int INPremove(char *, INPtables *);
|
||||||
int INPlookMod(char *);
|
INPmodel *INPlookMod(const char *);
|
||||||
int INPmakeMod(char *, int, card *);
|
int INPmakeMod(char *, int, card *);
|
||||||
char *INPmkTemp(char *);
|
char *INPmkTemp(char *);
|
||||||
void INPpas1(CKTcircuit *, card *, INPtables *);
|
void INPpas1(CKTcircuit *, card *, INPtables *);
|
||||||
|
|
|
||||||
|
|
@ -2,32 +2,27 @@
|
||||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||||
Author: 1985 Thomas L. Quarles
|
Author: 1985 Thomas L. Quarles
|
||||||
**********/
|
**********/
|
||||||
/*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ngspice/ngspice.h"
|
#include "ngspice/ngspice.h"
|
||||||
#include <stdio.h>
|
|
||||||
#include "ngspice/inpdefs.h"
|
#include "ngspice/inpdefs.h"
|
||||||
#include "inp.h"
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
extern INPmodel *modtab;
|
extern INPmodel *modtab;
|
||||||
|
|
||||||
/*-----------------------------------------------------------------
|
|
||||||
* This fcn accepts a pointer to the model name, and returns 1 if
|
|
||||||
* the model exists in the model table, and returns 0 if hte model
|
|
||||||
* doesn't exist in the model table.
|
|
||||||
*----------------------------------------------------------------*/
|
|
||||||
int INPlookMod(char *name)
|
|
||||||
{
|
|
||||||
register INPmodel **i;
|
|
||||||
|
|
||||||
for (i = &modtab; *i != NULL; i = &((*i)->INPnextModel)) {
|
/*-----------------------------------------------------------------
|
||||||
if (strcmp((*i)->INPmodName, name) == 0) {
|
* This fcn accepts a pointer to the model name, and returns
|
||||||
/* found the model in question - return TRUE */
|
* the INPmodel * if it exist in the model table.
|
||||||
return (1);
|
*----------------------------------------------------------------*/
|
||||||
}
|
|
||||||
}
|
INPmodel *
|
||||||
/* didn't find model - return FALSE */
|
INPlookMod(const char *name)
|
||||||
return (0);
|
{
|
||||||
|
INPmodel *i;
|
||||||
|
|
||||||
|
for (i = modtab; i; i = i->INPnextModel)
|
||||||
|
if (strcmp(i->INPmodName, name) == 0)
|
||||||
|
return i;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue