Jspice3
srcload.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 <math.h>
12 #include "srcdefs.h"
13 #include "sperror.h"
14 #include "util.h"
15 
16 
17 int
18 SRCload(inModel,ckt)
19 
20 GENmodel *inModel;
21 CKTcircuit *ckt;
22 {
23  SRCmodel *model = (SRCmodel *)inModel;
24  SRCinstance *here;
25 
26  /* loop through all the voltage source models */
27  for ( ; model != NULL; model = model->SRCnextModel) {
28 
29  if (ckt->CKTmode & (MODEDCOP | MODEDCTRANCURVE)) {
30 
31  /* loop through all the instances of the model */
32  for (here = model->SRCinstances; here != NULL;
33  here = here->SRCnextInstance) {
34 
35  (*here->SRCdcFunc)(ckt,here);
36 
37  }
38  }
39  else {
40  /* loop through all the instances of the model */
41  for (here = model->SRCinstances; here != NULL;
42  here = here->SRCnextInstance) {
43 
44  (*here->SRCtranFunc)(ckt,here);
45 
46  }
47  }
48  }
49  return (OK);
50 }
struct sSRCinstance * SRCnextInstance
Definition: srcdefs.h:26
#define MODEDCTRANCURVE
Definition: cktdefs.h:152
void(* SRCdcFunc)()
Definition: srcdefs.h:61
#define OK
Definition: iferrmsg.h:17
#define NULL
Definition: spdefs.h:121
SRCinstance * SRCinstances
Definition: srcdefs.h:205
int SRCload(GENmodel *inModel, CKTcircuit *ckt)
Definition: srcload.c:18
static char model[32]
Definition: subckt.c:76
#define MODEDCOP
Definition: cktdefs.h:150
long CKTmode
Definition: cktdefs.h:139
void(* SRCtranFunc)()
Definition: srcdefs.h:60
struct sSRCmodel * SRCnextModel
Definition: srcdefs.h:202