Jspice3
srcfbr.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: 1985 Thomas L. Quarles
5  1987 Kanwar Jit Singh
6  1992 Stephen R. Whiteley
7 ****************************************************************************/
8 
9 #include "spice.h"
10 #include <stdio.h>
11 #include "srcdefs.h"
12 #include "sperror.h"
13 #include "util.h"
14 #include "cktext.h"
15 
16 
17 int
18 SRCfindBr(ckt,inputModel,name)
19 
20 CKTcircuit *ckt;
21 GENmodel *inputModel;
22 IFuid name;
23 {
24  SRCinstance *here;
25  SRCmodel *model = (SRCmodel*)inputModel;
26  int error;
27  CKTnode *tmp;
28 
29  for ( ; model != NULL; model = model->SRCnextModel) {
30  for (here = model->SRCinstances; here != NULL;
31  here = here->SRCnextInstance) {
32  if (here->SRCname == name && here->SRCtype == SRC_V) {
33  if (here->SRCbranch == 0) {
34  error = CKTmkCur(ckt,&tmp, here->SRCname,"branch");
35  if (error)
36  return (error);
37  here->SRCbranch = tmp->number;
38  }
39  return (here->SRCbranch);
40  }
41  }
42  }
43  return (0);
44 }
struct sSRCinstance * SRCnextInstance
Definition: srcdefs.h:26
#define SRC_V
Definition: srcdefs.h:217
int SRCfindBr(CKTcircuit *ckt, GENmodel *inputModel, IFuid name)
Definition: srcfbr.c:18
GENERIC * IFuid
Definition: ifsim.h:72
int SRCbranch
Definition: srcdefs.h:47
#define NULL
Definition: spdefs.h:121
SRCinstance * SRCinstances
Definition: srcdefs.h:205
int number
Definition: cktdefs.h:39
int CKTmkCur()
static char model[32]
Definition: subckt.c:76
IFuid SRCname
Definition: srcdefs.h:29
int SRCtype
Definition: srcdefs.h:65
struct sSRCmodel * SRCnextModel
Definition: srcdefs.h:202