Jspice3
inpmkmod.c File Reference
#include "spice.h"
#include "inpdefs.h"
#include "iferrmsg.h"
#include "misc.h"
Include dependency graph for inpmkmod.c:

Go to the source code of this file.

Functions

int INPmakeMod (char *token, int type, card *line)
 

Variables

INPmodelmodtab
 

Function Documentation

int INPmakeMod ( char *  token,
int  type,
card line 
)

Definition at line 18 of file inpmkmod.c.

23 {
24  INPmodel **i;
25 
26  for (i = &modtab; *i != (INPmodel *)NULL; i = &((*i)->INPnextModel)) {
27  if (strcmp((*i)->INPmodName,token) == 0) {
28  return (OK);
29  }
30  }
31  *i = (INPmodel *)tmalloc(sizeof(INPmodel));
32  if (*i == NULL) return (E_NOMEM);
33  (*i)->INPmodName = token;
34  (*i)->INPmodType = type;
35  (*i)->INPnextModel = (INPmodel *)NULL;
36  (*i)->INPmodUsed = 0;
37  (*i)->INPmodLine = line;
38  (*i)->INPmodfast = NULL;
39  return (OK);
40 }
#define OK
Definition: iferrmsg.h:17
char * tmalloc()
INPmodel * modtab
Definition: inpmkmod.c:13
#define NULL
Definition: spdefs.h:121
Definition: types.c:18
#define E_NOMEM
Definition: iferrmsg.h:27

Variable Documentation

INPmodel* modtab

Definition at line 13 of file inpmkmod.c.