Jspice3
Main Page
Data Structures
Files
File List
Globals
cktpmnam.c
Go to the documentation of this file.
1
/***************************************************************************
2
JSPICE3 adaptation of Spice3f2 - 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
1993 Stephen R. Whiteley
6
****************************************************************************/
7
8
/*
9
* CKTpModName()
10
*
11
* Take a parameter by Name and set it on the specified model
12
*/
13
14
#include "
spice.h
"
15
#include <stdio.h>
16
#include "
devdefs.h
"
17
#include "
sperror.h
"
18
#include "
util.h
"
19
#include "
cktext.h
"
20
21
22
extern
SPICEdev
*
DEVices
[];
23
24
/* ARGSUSED */
25
int
26
CKTpModName
(parm,val,ckt,
type
,name,modfast)
27
28
char *parm;
/* the name of the parameter to set */
29
IFvalue
*val;
/* the parameter union containing the value to set */
30
CKTcircuit
*ckt;
/* the circuit this model is a member of */
31
int
type
;
/* the device type code to the model being parsed */
32
IFuid
name;
/* the name of the model being parsed */
33
GENmodel
**modfast;
/* direct pointer to model being parsed */
34
{
35
int
error;
/* int to store evaluate error return codes in */
36
int
i;
37
38
for
(i = 0; i < *DEVices[
type
]->
DEVpublic
.
numModelParms
; i++) {
39
if
(!strcmp(parm,DEVices[type]->DEVpublic.modelParms[i].keyword)) {
40
error =
CKTmodParam
((
GENERIC
*)ckt,(
GENERIC
*)*modfast,
41
DEVices[type]->DEVpublic.modelParms[i].id,val,
42
(
IFvalue
*)
NULL
);
43
if
(error)
return
(error);
44
break
;
45
}
46
}
47
if
(i == *DEVices[type]->DEVpublic.numModelParms) {
48
return
(
E_BADPARM
);
49
}
50
return
(
OK
);
51
}
CKTcircuit
Definition:
cktdefs.h:62
sIFdevice::numModelParms
int * numModelParms
Definition:
ifsim.h:315
E_BADPARM
#define E_BADPARM
Definition:
iferrmsg.h:26
SPICEdev::DEVpublic
IFdevice DEVpublic
Definition:
devdefs.h:44
CKTmodParam
int CKTmodParam()
OK
#define OK
Definition:
iferrmsg.h:17
IFuid
GENERIC * IFuid
Definition:
ifsim.h:72
sperror.h
CKTpModName
int CKTpModName(char *parm, IFvalue *val, CKTcircuit *ckt, int type, IFuid name, GENmodel **modfast)
Definition:
cktpmnam.c:26
NULL
#define NULL
Definition:
spdefs.h:121
type
Definition:
types.c:18
util.h
spice.h
sGENmodel
Definition:
gendefs.h:39
cktext.h
SPICEdev
Definition:
devdefs.h:43
sCKTmodHead::type
int type
Definition:
cktdefs.h:56
uIFvalue
Definition:
ifsim.h:231
DEVices
SPICEdev * DEVices[]
Definition:
sconfig.c:109
devdefs.h
GENERIC
char GENERIC
Definition:
ifsim.h:27
src
lib
ckt
cktpmnam.c
Generated by
1.8.11