Jspice3
Main Page
Data Structures
Files
File List
Globals
inpmkmod.c
Go to the documentation of this file.
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
18
INPmakeMod
(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
}
misc.h
card
Definition:
inpdefs.h:62
OK
#define OK
Definition:
iferrmsg.h:17
tmalloc
char * tmalloc()
line
Definition:
fteinp.h:14
modtab
INPmodel * modtab
Definition:
inpmkmod.c:13
NULL
#define NULL
Definition:
spdefs.h:121
type
Definition:
types.c:18
inpdefs.h
E_NOMEM
#define E_NOMEM
Definition:
iferrmsg.h:27
spice.h
iferrmsg.h
sINPmodel
Definition:
inpdefs.h:71
INPmakeMod
int INPmakeMod(char *token, int type, card *line)
Definition:
inpmkmod.c:18
src
lib
inp
inpmkmod.c
Generated by
1.8.11