Jspice3
ltradest.c File Reference
#include "spice.h"
#include <stdio.h>
#include "ltradefs.h"
#include "util.h"
Include dependency graph for ltradest.c:

Go to the source code of this file.

Functions

void LTRAdestroy (GENmodel **model)
 

Function Documentation

void LTRAdestroy ( GENmodel **  model)

Definition at line 20 of file ltradest.c.

23 {
24 
25  GENinstance *here, *next;
26  GENmodel *mod, *nextmod;
27 
28  for (mod = *model; mod; mod = nextmod) {
29  nextmod = mod->GENnextModel;
30  for (here = mod->GENinstances; here; here = next) {
31  next = here->GENnextInstance;
32  FREE(((LTRAinstance*)here)->LTRAv1);
33  FREE(((LTRAinstance*)here)->LTRAi1);
34  FREE(((LTRAinstance*)here)->LTRAv2);
35  FREE(((LTRAinstance*)here)->LTRAi2);
36  FREE(here);
37  }
38  FREE(((LTRAmodel*)mod)->LTRAh1dashCoeffs);
39  FREE(((LTRAmodel*)mod)->LTRAh2Coeffs);
40  FREE(((LTRAmodel*)mod)->LTRAh3dashCoeffs);
41  FREE(mod);
42  }
43  *model = NULL;
44 }
struct sGENinstance * GENnextInstance
Definition: gendefs.h:26
struct sGENmodel * GENnextModel
Definition: gendefs.h:41
#define FREE(ptr)
Definition: spdefs.h:436
#define NULL
Definition: spdefs.h:121
GENinstance * GENinstances
Definition: gendefs.h:43