Jspice3
gendest.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - 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  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 /*
9  * This routine deletes all typed models and instances from the circuit
10  * and frees the storage they were using.
11  */
12 
13 #include "spice.h"
14 #include <stdio.h>
15 #include "gendefs.h"
16 #include "util.h"
17 
18 
19 void
21 
22 GENmodel **model;
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
static char model[32]
Definition: subckt.c:76
void GENdestroy(GENmodel **model)
Definition: gendest.c:20
GENinstance * GENinstances
Definition: gendefs.h:43