Jspice3
Main Page
Data Structures
Files
File List
Globals
cktmapn.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
/* CKTmapNode(ckt,node)
9
* map the given node to the compact node numbering set of the
10
* specified circuit
11
*/
12
13
#include "
spice.h
"
14
#include <stdio.h>
15
#include "
cktdefs.h
"
16
#include "
sperror.h
"
17
#include "
cktext.h
"
18
19
20
/* ARGSUSED */
21
int
22
CKTmapNode
(ckt,node,name)
23
24
GENERIC
*ckt;
25
GENERIC
**node;
26
IFuid
name;
27
{
28
CKTnode
*here;
29
int
error;
30
IFuid
uid;
31
CKTnode
*mynode;
32
33
for
(here = ((
CKTcircuit
*)ckt)->CKTnodes; here; here = here->
next
) {
34
if
(here->
name
== name) {
35
if
(node) *node = (
char
*)here;
36
return
(
E_EXISTS
);
37
}
38
}
39
/* not found, so must be a new one */
40
error =
CKTmkNode
((
CKTcircuit
*)ckt,&mynode);
/*allocate the node*/
41
if
(error)
return
(error);
42
error = (*(
SPfrontEnd
->IFnewUid))((
GENERIC
*)ckt,&uid,(
IFuid
*)
NULL
,name,
43
UID_SIGNAL
,(
GENERIC
**)mynode);
/* get a uid for it */
44
if
(error)
return
(error);
45
mynode->
name
= uid;
/* set the info we have */
46
mynode->
type
=
SP_VOLTAGE
;
47
error =
CKTlinkEq
((
CKTcircuit
*)ckt,mynode);
/* and link it in */
48
if
(node) *node = (
GENERIC
*)mynode;
/* and finally, return it */
49
return
(
OK
);
50
}
cktdefs.h
sCKTnode::name
IFuid name
Definition:
cktdefs.h:31
CKTcircuit
Definition:
cktdefs.h:62
sCKTnode
Definition:
cktdefs.h:30
SPfrontEnd
IFfrontEnd * SPfrontEnd
Definition:
main.c:917
UID_SIGNAL
#define UID_SIGNAL
Definition:
ifsim.h:84
E_EXISTS
#define E_EXISTS
Definition:
iferrmsg.h:20
CKTlinkEq
int CKTlinkEq()
SP_VOLTAGE
#define SP_VOLTAGE
Definition:
cktdefs.h:34
OK
#define OK
Definition:
iferrmsg.h:17
IFuid
GENERIC * IFuid
Definition:
ifsim.h:72
sperror.h
sCKTnode::type
int type
Definition:
cktdefs.h:32
NULL
#define NULL
Definition:
spdefs.h:121
sCKTnode::next
struct sCKTnode * next
Definition:
cktdefs.h:43
spice.h
CKTmapNode
int CKTmapNode(GENERIC *ckt, GENERIC **node, IFuid name)
Definition:
cktmapn.c:22
cktext.h
CKTmkNode
int CKTmkNode()
GENERIC
char GENERIC
Definition:
ifsim.h:27
src
lib
ckt
cktmapn.c
Generated by
1.8.11