Jspice3
srcdest.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 "util.h"
13 
14 
15 void
16 SRCdestroy(inModel)
17 
18 GENmodel **inModel;
19 {
20  SRCmodel **model = (SRCmodel **)inModel;
21  SRCinstance *here, *next;
22  SRCmodel *mod, *nextmod;
23 
24  for (mod = *model; mod; mod = nextmod) {
25  nextmod = mod->SRCnextModel;
26  for (here = mod->SRCinstances; here; here = next) {
27  next = here->SRCnextInstance;
28  FREE(here->SRCvalues);
29  FREE(here->SRCderivs);
30  FREE(here->SRCeqns);
31  FREE(here->SRCacValues);
32  FREE(here->SRCposptr);
33  if (here->SRCtree)
34  (*here->SRCtree->IFfree)(here->SRCtree);
35  FREE(here);
36  }
37  FREE(mod);
38  }
39  *model = NULL;
40 }
struct sSRCinstance * SRCnextInstance
Definition: srcdefs.h:26
double * SRCvalues
Definition: srcdefs.h:109
void SRCdestroy(GENmodel **inModel)
Definition: srcdest.c:16
int * SRCeqns
Definition: srcdefs.h:118
#define FREE(ptr)
Definition: spdefs.h:436
#define NULL
Definition: spdefs.h:121
SRCinstance * SRCinstances
Definition: srcdefs.h:205
double ** SRCposptr
Definition: srcdefs.h:53
static char model[32]
Definition: subckt.c:76
double * SRCacValues
Definition: srcdefs.h:106
double * SRCderivs
Definition: srcdefs.h:115
IFparseTree * SRCtree
Definition: srcdefs.h:103
struct sSRCmodel * SRCnextModel
Definition: srcdefs.h:202