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
|
||||
* src/frontend/com_compose.c ,
|
||||
* src/frontend/define.c ,
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ int INPinsertNofree(char **token, INPtables *tab);
|
|||
int INPinsert(char **, INPtables *);
|
||||
int INPretrieve(char **, INPtables *);
|
||||
int INPremove(char *, INPtables *);
|
||||
int INPlookMod(char *);
|
||||
INPmodel *INPlookMod(const char *);
|
||||
int INPmakeMod(char *, int, card *);
|
||||
char *INPmkTemp(char *);
|
||||
void INPpas1(CKTcircuit *, card *, INPtables *);
|
||||
|
|
|
|||
|
|
@ -2,32 +2,27 @@
|
|||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Thomas L. Quarles
|
||||
**********/
|
||||
/*
|
||||
*/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include "ngspice/inpdefs.h"
|
||||
#include "inp.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
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) {
|
||||
/* found the model in question - return TRUE */
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
/* didn't find model - return FALSE */
|
||||
return (0);
|
||||
/*-----------------------------------------------------------------
|
||||
* This fcn accepts a pointer to the model name, and returns
|
||||
* the INPmodel * if it exist in the model table.
|
||||
*----------------------------------------------------------------*/
|
||||
|
||||
INPmodel *
|
||||
INPlookMod(const char *name)
|
||||
{
|
||||
INPmodel *i;
|
||||
|
||||
for (i = modtab; i; i = i->INPnextModel)
|
||||
if (strcmp(i->INPmodName, name) == 0)
|
||||
return i;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue