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

Go to the source code of this file.

Functions

void B2destroy (GENmodel **inModel)
 

Function Documentation

void B2destroy ( GENmodel **  inModel)

Definition at line 15 of file b2dest.c.

18 {
19 
20  B2model **model = (B2model**)inModel;
21  B2instance *here;
22  B2instance *prev = NULL;
23  B2model *mod = *model;
24  B2model *oldmod = NULL;
25 
26  for( ; mod ; mod = mod->B2nextModel) {
27  if(oldmod) FREE(oldmod);
28  oldmod = mod;
29  prev = (B2instance *)NULL;
30  for(here = mod->B2instances ; here ; here = here->B2nextInstance) {
31  if(prev) FREE(prev);
32  prev = here;
33  }
34  if(prev) FREE(prev);
35  }
36  if(oldmod) FREE(oldmod);
37  *model = NULL;
38 }
B2instance * B2instances
Definition: bsim2def.h:226
struct sBSIM2instance * B2nextInstance
Definition: bsim2def.h:19
#define FREE(ptr)
Definition: spdefs.h:436
#define NULL
Definition: spdefs.h:121
static char model[32]
Definition: subckt.c:76
struct sBSIM2model * B2nextModel
Definition: bsim2def.h:224