Jspice3
Main Page
Data Structures
Files
File List
Globals
inpnrefs.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: 1993 Stephen R. Whiteley
5
****************************************************************************/
6
7
#include "
spice.h
"
8
#include "
inpdefs.h
"
9
10
int
11
INPnumRefs
(
c
,terms,devs,soft,hasmod)
12
13
/*
14
* Find the number of nodes used by the device keyed by c, and the
15
* number of devices referenced. Also the soft flag, and whether the
16
* device has a model.
17
*/
18
int
c
;
19
int
*terms, *devs;
20
int
*soft, *hasmod;
21
{
22
int
i, j;
23
IFdevice
*dev;
24
25
if
(isalpha(c)) {
26
if
(isupper(c)) c = tolower(c);
27
28
for
(i = 0; i <
ft_sim
->
numDevices
; i++) {
29
dev =
ft_sim
->
devices
[i];
30
for
(j = 0; j < *dev->
numKeys
; j++) {
31
if
(dev->
keys
[j].
key
== c)
32
break
;
33
}
34
if
(j < *dev->numKeys) {
35
if
(terms) *terms = dev->
keys
[j].
numTerms
;
36
if
(devs) *devs = dev->
keys
[j].
numDevs
;
37
if
(soft) *soft = dev->
keys
[j].
soft
;
38
if
(hasmod) *hasmod = (dev->
modelKeys
? 1 : 0);
39
return
(1);
40
}
41
}
42
}
43
if
(terms) *terms = 0;
44
if
(devs) *devs = 0;
45
if
(soft) *soft = 0;
46
if
(hasmod) *hasmod = 0;
47
return
(0);
48
}
sIFdevice::keys
IFkeys * keys
Definition:
ifsim.h:297
ft_sim
IFsimulator * ft_sim
Definition:
main.c:111
sIFdevice
Definition:
ifsim.h:292
sIFkeys::soft
int soft
Definition:
ifsim.h:271
sIFkeys::numTerms
int numTerms
Definition:
ifsim.h:269
sIFsimulator::devices
IFdevice ** devices
Definition:
ifsim.h:461
sIFdevice::modelKeys
char ** modelKeys
Definition:
ifsim.h:305
inpdefs.h
sIFkeys::key
char key
Definition:
ifsim.h:268
spice.h
INPnumRefs
int INPnumRefs(int c, int *terms, int *devs, int *soft, int *hasmod)
Definition:
inpnrefs.c:11
c
Definition:
cddefs.h:177
sIFkeys::numDevs
int numDevs
Definition:
ifsim.h:272
sIFdevice::numKeys
int * numKeys
Definition:
ifsim.h:296
sIFsimulator::numDevices
int numDevices
Definition:
ifsim.h:460
src
lib
inp
inpnrefs.c
Generated by
1.8.11