home · contact · privacy
a9dd2f9cf604540010bb64778f07a9c8458851e3
[plomrogue] / src / client / cleanup.h
1 /* src/client/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_NCURSES    = 0x0001,
22     CLEANUP_INTERFACE  = 0x0002,
23     CLEANUP_COMMANDS   = 0x0004,
24     CLEANUP_SERVER_IN  = 0x0008,
25     CLEANUP_SERVER_OUT = 0x0008
26 };
27
28 extern void set_cleanup_flag(enum cleanup_flag flag);
29
30 /* Frees memory and properly winds down ncurses / resets the terminal. */
31 extern void cleanup();
32
33
34
35 #endif