home · contact · privacy
License everything (GPL).
[plomrogue] / src / server / cleanup.h
1 /* src/server/cleanup.h
2  *
3  * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3
4  * or any later version. For details on its copyright, license, and warranties,
5  * see the file NOTICE in the root directory of the PlomRogue source package.
6  *
7  * Stuff defining / performing the cleanup called by rexit.h's exit functions.
8  */
9
10 #ifndef CLEANUP_H
11 #define CLEANUP_H
12
13
14
15 /* set_cleanup_flag() sets any of the flags defined in cleanup_flag to announce
16  * the resources that need cleaning up upon program exit. It is to be called at
17  * the earliest moment possible after resource creation / initialization.
18  */
19 enum cleanup_flag
20 {
21     CLEANUP_FIFO          = 0x0001,
22     CLEANUP_WORLDSTATE    = 0x0002,
23     CLEANUP_THING_TYPES   = 0x0004,
24     CLEANUP_THINGS        = 0x0008,
25     CLEANUP_THING_ACTIONS = 0x0010,
26     CLEANUP_IN            = 0x0020,
27     CLEANUP_OUT           = 0x0040
28 };
29
30 /* In addition, unset_cleanup_flag() may be used to unset flags. */
31 extern void set_cleanup_flag(enum cleanup_flag flag);
32 extern void unset_cleanup_flag(enum cleanup_flag flag);
33
34 /* Frees memory and unlinks some files. */
35 extern void cleanup();
36
37
38
39 #endif