1 |
johnpye |
485 |
/* ASCEND modelling environment |
2 |
|
|
Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly |
3 |
|
|
Copyright (C) 2006 Carnegie Mellon University |
4 |
aw0a |
1 |
|
5 |
johnpye |
485 |
This program is free software; you can redistribute it and/or modify |
6 |
|
|
it under the terms of the GNU General Public License as published by |
7 |
|
|
the Free Software Foundation; either version 2, or (at your option) |
8 |
|
|
any later version. |
9 |
aw0a |
1 |
|
10 |
johnpye |
485 |
This program is distributed in the hope that it will be useful, |
11 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
|
|
GNU General Public License for more details. |
14 |
|
|
|
15 |
|
|
You should have received a copy of the GNU General Public License |
16 |
|
|
along with this program; if not, write to the Free Software |
17 |
|
|
Foundation, Inc., 59 Temple Place - Suite 330, |
18 |
|
|
Boston, MA 02111-1307, USA. |
19 |
|
|
*//** |
20 |
|
|
@file |
21 |
|
|
Instance Garbage Dump |
22 |
|
|
|
23 |
|
|
This is a resting place for un-needed instances. They may be stored in |
24 |
|
|
the dump in case they are needed later on. Only pure instance should |
25 |
|
|
be stored in the dump, and the dumping procedure is responsible for |
26 |
|
|
making sure that the instance it "pure", and unconnected to anything |
27 |
|
|
else. Typically, these restrictions are only met by atoms. |
28 |
|
|
|
29 |
|
|
Requires: |
30 |
|
|
#include "utilities/ascConfig.h" |
31 |
|
|
#include "instance_enum.h" |
32 |
|
|
#include "compiler.h" |
33 |
|
|
*//* |
34 |
|
|
by Tom Epperly |
35 |
|
|
10/24/89 |
36 |
|
|
Version: $Revision: 1.7 $ |
37 |
|
|
Version control file: $RCSfile: dump.h,v $ |
38 |
|
|
Date last modified: $Date: 1998/02/05 16:35:51 $ |
39 |
|
|
Last modified by: $Author: ballan $ |
40 |
|
|
*/ |
41 |
|
|
|
42 |
johnpye |
162 |
#ifndef ASC_DUMP_H |
43 |
|
|
#define ASC_DUMP_H |
44 |
jds |
54 |
|
45 |
johnpye |
1066 |
/** addtogroup compiler Compiler |
46 |
|
|
@{ |
47 |
|
|
*/ |
48 |
|
|
|
49 |
johnpye |
485 |
#include <utilities/ascConfig.h> |
50 |
|
|
|
51 |
aw0a |
1 |
#define MESSYTHRESH 10 |
52 |
|
|
|
53 |
|
|
extern void InitDump(void); |
54 |
johnpye |
480 |
/**< |
55 |
aw0a |
1 |
* Must be called to initialize the dump. |
56 |
|
|
*/ |
57 |
|
|
|
58 |
johnpye |
1063 |
ASC_DLLSPEC void EmptyTrash(void); |
59 |
johnpye |
480 |
/**< |
60 |
aw0a |
1 |
* Delete all the instances in the dump. The dump can still be used |
61 |
|
|
* after this call. |
62 |
|
|
*/ |
63 |
|
|
|
64 |
|
|
extern void TendTrash(void); |
65 |
johnpye |
480 |
/**< |
66 |
jds |
54 |
* This is a less drastic version of EmptyTrash(), which only deletes |
67 |
aw0a |
1 |
* instance with too many copies in the dump. Too many is more than |
68 |
|
|
* MESSYTHRES copies of a given type. |
69 |
|
|
*/ |
70 |
|
|
|
71 |
jds |
54 |
extern void TrashType(symchar *str); |
72 |
johnpye |
480 |
/**< |
73 |
aw0a |
1 |
* Delete any copies of type 'str' from the dump. This should be called |
74 |
|
|
* if for instance the definition of 'str' is being changed. In such |
75 |
|
|
* cases, fetching copies of 'str' from the dump would return the old |
76 |
jds |
54 |
* version.<br><br> |
77 |
aw0a |
1 |
* |
78 |
|
|
* str should have no leading blanks and should be a valid identifier. |
79 |
|
|
*/ |
80 |
|
|
|
81 |
jds |
54 |
extern void AddInstance(struct Instance *i); |
82 |
|
|
/**< |
83 |
aw0a |
1 |
* This adds instance i to the trash dump. |
84 |
|
|
*/ |
85 |
|
|
|
86 |
jds |
54 |
extern struct Instance *FindInstance(symchar *str); |
87 |
johnpye |
480 |
/**< |
88 |
aw0a |
1 |
* This will return an instance if it one is available; otherwise, it |
89 |
|
|
* returns NULL. |
90 |
|
|
*/ |
91 |
|
|
|
92 |
johnpye |
1066 |
/* @} */ |
93 |
|
|
|
94 |
johnpye |
162 |
#endif /* ASC_DUMP_H */ |
95 |
jds |
54 |
|