Jspice3
cktmkvol.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  /* CKTmkVolt
9  * make the given name a 'node' of type current in the
10  * specified circuit
11  */
12 
13 #include "spice.h"
14 #include <stdio.h>
15 #include "cktdefs.h"
16 #include "sperror.h"
17 #include "util.h"
18 #include "cktext.h"
19 
20 
21 /* ARGSUSED */
22 int
23 CKTmkVolt(ckt,node,basename,suffix)
24 
25 CKTcircuit *ckt;
26 CKTnode **node;
27 IFuid basename;
28 char *suffix;
29 {
30  IFuid uid;
31  int error;
32  CKTnode *mynode;
33  CKTnode *checknode;
34 
35  error = CKTmkNode(ckt,&mynode);
36  if (error) return (error);
37  checknode = mynode;
38  error = (*(SPfrontEnd->IFnewUid))((GENERIC *)ckt,&uid,basename,
39  suffix,UID_SIGNAL,(GENERIC**)&checknode);
40  if (error) {
41  FREE(mynode);
42  if (node) *node = checknode;
43  return (error);
44  }
45  mynode->name = uid;
46  mynode->type = SP_VOLTAGE;
47  if (node) *node = mynode;
48  error = CKTlinkEq(ckt,mynode);
49  return (error);
50 }
IFuid name
Definition: cktdefs.h:31
IFfrontEnd * SPfrontEnd
Definition: main.c:917
#define UID_SIGNAL
Definition: ifsim.h:84
#define FREE(ptr)
Definition: spdefs.h:436
int CKTlinkEq()
#define SP_VOLTAGE
Definition: cktdefs.h:34
GENERIC * IFuid
Definition: ifsim.h:72
int type
Definition: cktdefs.h:32
int CKTmkVolt(CKTcircuit *ckt, CKTnode **node, IFuid basename, char *suffix)
Definition: cktmkvol.c:23
int CKTmkNode()
char GENERIC
Definition: ifsim.h:27