home · contact · privacy
8a5444f08b8b06f7336824b4475470c99e045c86
[plomrogue] / src / rexit.h
1 /* rexit.h
2  *
3  * Routines to exit the game orderly or on error, with as much cleaning up as is
4  * possible in both cases.
5  */
6
7 #ifndef REXIT_H
8 #define REXIT_H
9
10
11
12 struct World;
13 struct Map;
14
15
16
17 /* set_cleanup_flag() sets any of the flags defined in cleanup_flag to announce
18  * the resources that need cleaning up upon program exit. It is to be called at
19  * the earliest moment possible after resource creation / initialization.
20  */
21 enum cleanup_flag
22 {
23     CLEANUP_NCURSES     = 0x01,
24     CLEANUP_MAP         = 0x02,
25     CLEANUP_KEYBINDINGS = 0x04,
26     CLEANUP_LOG         = 0x08
27 };
28 extern void set_cleanup_flag(enum cleanup_flag flag);
29
30
31
32 /* Exit orderly without message or on error with an error message ("msg").
33  */
34 extern void exit_game(struct World * world);
35 extern void exit_err(struct World * world, char * msg);
36
37
38
39 #endif