1 /*************************************************************************** 2 JSPICE3 adaptation of Spice3e2 - Copyright (c) Stephen R. Whiteley 1992 3 Copyright 1990 Regents of the University of California. All rights reserved. 4 Authors: 1985 Thomas L. Quarles 5 1992 Stephen R. Whiteley 6 ****************************************************************************/ 7 8 #include "spice.h" 9 #include "inpdefs.h" 10 #include "iferrmsg.h" 11 #include "misc.h" 12 13 INPmodel *modtab; 14 15 /* create/lookup a 'model' entry */ 16 17 int INPmakeMod(token,type,line)18INPmakeMod(token,type,line) 19 20 char *token; 21 int type; 22 card *line; 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 } 41