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

Go to the source code of this file.

Functions

int SRCload (GENmodel *inModel, CKTcircuit *ckt)
 

Function Documentation

int SRCload ( GENmodel inModel,
CKTcircuit ckt 
)

Definition at line 18 of file srcload.c.

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