Jspice3
srcfbr.c File Reference
#include "spice.h"
#include <stdio.h>
#include "srcdefs.h"
#include "sperror.h"
#include "util.h"
#include "cktext.h"
Include dependency graph for srcfbr.c:

Go to the source code of this file.

Functions

int SRCfindBr (CKTcircuit *ckt, GENmodel *inputModel, IFuid name)
 

Function Documentation

int SRCfindBr ( CKTcircuit ckt,
GENmodel inputModel,
IFuid  name 
)

Definition at line 18 of file srcfbr.c.

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 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