3 * Routines to exit the game orderly or on error, with as much cleaning up as is
4 * possible in both cases.
12 #include <stdint.h> /* for uint8_t */
18 /* set_cleanup_flag() sets any of the flags defined in cleanup_flag to announce
19 * the resources that need cleaning up upon program exit. It is to be called at
20 * the earliest moment possible after resource creation / initialization.
24 CLEANUP_NCURSES = 0x01,
26 CLEANUP_KEYBINDINGS = 0x04,
29 extern void set_cleanup_flag(enum cleanup_flag flag);
33 /* Exit orderly, clean up. */
34 extern void exit_game(struct World * world);
38 /* If "err" != 0, exit with an error message "msg" and clean up. If "msg" is a
39 * NULL pointer, return generic "Details unknown". In any case, also print "err"
40 * as the "internal error code". Also print errno if it is non-zero.
42 extern void exit_err(uint8_t err, struct World * world, char * msg);