Jspice3
cktnames.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  * CKTnames(ckt)
10  * output information on all circuit nodes/equations
11  *
12  */
13 
14 #include "spice.h"
15 #include <stdio.h>
16 #include "cktdefs.h"
17 #include "iferrmsg.h"
18 #include "util.h"
19 #include "cktext.h"
20 
21 
22 int
23 CKTnames(ckt,numNames,nameList)
24 
25 CKTcircuit *ckt;
26 int *numNames;
27 IFuid **nameList;
28 {
29  CKTnode *here;
30  int i;
31  *numNames = ckt->CKTmaxEqNum - 1;
32  *nameList = (IFuid *)MALLOC(*numNames * sizeof(IFuid));
33  if ((*nameList) == (IFuid *)NULL) return (E_NOMEM);
34  i = 0;
35  for (here = ckt->CKTnodes->next; here; here = here->next) {
36  *((*nameList) + i++) = here->name;
37  }
38  return (OK);
39 }
IFuid name
Definition: cktdefs.h:31
int CKTnames(CKTcircuit *ckt, int *numNames, IFuid **nameList)
Definition: cktnames.c:23
#define OK
Definition: iferrmsg.h:17
GENERIC * IFuid
Definition: ifsim.h:72
#define MALLOC(x)
Definition: util.h:9
#define NULL
Definition: spdefs.h:121
#define E_NOMEM
Definition: iferrmsg.h:27
struct sCKTnode * next
Definition: cktdefs.h:43