1 |
/* ASCEND modelling environment |
2 |
Copyright (C) 1990, 1993, 1994 Thomas Guthrie Epperly |
3 |
Copyright (C) 2006 Carnegie Mellon University |
4 |
|
5 |
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 |
|
10 |
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 |
#ifndef ASC_DUMP_H |
43 |
#define ASC_DUMP_H |
44 |
|
45 |
#include <utilities/ascConfig.h> |
46 |
|
47 |
#define MESSYTHRESH 10 |
48 |
|
49 |
extern void InitDump(void); |
50 |
/**< |
51 |
* Must be called to initialize the dump. |
52 |
*/ |
53 |
|
54 |
ASC_DLLSPEC void EmptyTrash(void); |
55 |
/**< |
56 |
* Delete all the instances in the dump. The dump can still be used |
57 |
* after this call. |
58 |
*/ |
59 |
|
60 |
extern void TendTrash(void); |
61 |
/**< |
62 |
* This is a less drastic version of EmptyTrash(), which only deletes |
63 |
* instance with too many copies in the dump. Too many is more than |
64 |
* MESSYTHRES copies of a given type. |
65 |
*/ |
66 |
|
67 |
extern void TrashType(symchar *str); |
68 |
/**< |
69 |
* Delete any copies of type 'str' from the dump. This should be called |
70 |
* if for instance the definition of 'str' is being changed. In such |
71 |
* cases, fetching copies of 'str' from the dump would return the old |
72 |
* version.<br><br> |
73 |
* |
74 |
* str should have no leading blanks and should be a valid identifier. |
75 |
*/ |
76 |
|
77 |
extern void AddInstance(struct Instance *i); |
78 |
/**< |
79 |
* This adds instance i to the trash dump. |
80 |
*/ |
81 |
|
82 |
extern struct Instance *FindInstance(symchar *str); |
83 |
/**< |
84 |
* This will return an instance if it one is available; otherwise, it |
85 |
* returns NULL. |
86 |
*/ |
87 |
|
88 |
#endif /* ASC_DUMP_H */ |
89 |
|