1 /* src/client/cleanup.c */
4 #include <ncurses.h> /* for endwin() */
5 #include <stdint.h> /* uint32_t */
6 #include <stdlib.h> /* free() */
7 #include "../common/readwrite.h" /* try_fclose() */
8 #include "command_db.h" /* free_command_db() */
9 #include "misc.h" /* unload_interface_conf() */
10 #include "world.h" /* world global */
14 /* The clean-up flags set by set_cleanup_flag(). */
15 static uint32_t cleanup_flags = 0x0000;
21 char * f_name = "cleanup()";
22 free(world.map.cells);
24 free(world.player_inventory);
25 if (cleanup_flags & CLEANUP_INTERFACE)
27 unload_interface_conf();
29 if (cleanup_flags & CLEANUP_NCURSES)
33 if (cleanup_flags & CLEANUP_COMMANDS)
37 if (cleanup_flags & CLEANUP_SERVER_IN)
39 try_fclose(world.file_server_in, f_name);
41 if (cleanup_flags & CLEANUP_SERVER_OUT)
43 try_fclose(world.file_server_out, f_name);
48 extern void set_cleanup_flag(enum cleanup_flag flag)
50 cleanup_flags = cleanup_flags | flag;