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

Go to the source code of this file.

Functions

void GENdestroy (GENmodel **model)
 

Function Documentation

void GENdestroy ( GENmodel **  model)

Definition at line 20 of file gendest.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(here);
33  }
34  FREE(mod);
35  }
36  *model = NULL;
37 }
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