Jspice3
indfbr.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: 1987 Thomas L. Quarles
5  1992 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "inddefs.h"
11 #include "util.h"
12 #include "sperror.h"
13 #include "cktext.h"
14 
15 
16 int
17 INDfindBr(ckt,inModel,name)
18 
19 CKTcircuit *ckt;
20 GENmodel *inModel;
21 IFuid name;
22 {
23  INDmodel *model = (INDmodel *)inModel;
24  INDinstance *here;
25  int error;
26  CKTnode *tmp;
27 
28  for ( ; model != NULL; model = model->INDnextModel) {
29  for (here = model->INDinstances; here != NULL;
30  here = here->INDnextInstance) {
31  if (here->INDname == name) {
32  if (here->INDbrEq == 0) {
33  error = CKTmkCur(ckt,&tmp,here->INDname,"branch");
34  if (error) return(error);
35  here->INDbrEq = tmp->number;
36  }
37  return(here->INDbrEq);
38  }
39  }
40  }
41  return(0);
42 }
43 
struct sINDmodel * INDnextModel
Definition: inddefs.h:96
int INDfindBr(CKTcircuit *ckt, GENmodel *inModel, IFuid name)
Definition: indfbr.c:17
struct sINDinstance * INDnextInstance
Definition: inddefs.h:27
GENERIC * IFuid
Definition: ifsim.h:72
#define NULL
Definition: spdefs.h:121
INDinstance * INDinstances
Definition: inddefs.h:99
int number
Definition: cktdefs.h:39
int CKTmkCur()
static char model[32]
Definition: subckt.c:76
IFuid INDname
Definition: inddefs.h:30
int INDbrEq
Definition: inddefs.h:42