Jspice3
cktfbran.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  /* CKTfndBranch(ckt,name)
9  * this is a driver program to iterate through all the various
10  * findBranch functions provided for the circuit elements in the
11  * given circuit
12  */
13 
14 #include "spice.h"
15 #include <stdio.h>
16 #include "devdefs.h"
17 #include "cktext.h"
18 
19 
20 int
21 CKTfndBranch(ckt,name)
22 
23 CKTcircuit *ckt;
24 IFuid name;
25 {
26  extern SPICEdev *DEVices[];
27 
28  int j;
29  struct sCKTmodHead *mh;
30  int (*func)();
31 
32  for (mh = ckt->CKTheadList; mh != NULL; mh = mh->next) {
33  if ((func = DEVices[mh->type]->DEVfindBranch) != NULL) {
34  j = (*func)(ckt,mh->head,name);
35  if (j != 0) return (j);
36  }
37  }
38  return (0);
39 }
struct sCKTmodHead * next
Definition: cktdefs.h:58
SPICEdev * DEVices[]
Definition: sconfig.c:109
int CKTfndBranch(CKTcircuit *ckt, IFuid name)
Definition: cktfbran.c:21
GENERIC * IFuid
Definition: ifsim.h:72
#define NULL
Definition: spdefs.h:121
Definition: fteparse.h:37
int type
Definition: cktdefs.h:56
int(* DEVfindBranch)()
Definition: devdefs.h:97
GENmodel * head
Definition: cktdefs.h:57