X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fserver%2Fcleanup.c;h=ec8017d02369f261784f5dad92f6d65be7c27ace;hb=ac7521c1d40b86cd7d33cef590353692542fa0a4;hp=1959c1c831aedf979bd777b999a0bf09b5cff015;hpb=d92f16d5959fc846d3eaf669517eecb3969cda08;p=plomrogue diff --git a/src/server/cleanup.c b/src/server/cleanup.c index 1959c1c..ec8017d 100644 --- a/src/server/cleanup.c +++ b/src/server/cleanup.c @@ -1,10 +1,16 @@ -/* src/server/cleanup.c */ +/* src/server/cleanup.c + * + * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3 + * or any later version. For details on its copyright, license, and warranties, + * see the file NOTICE in the root directory of the PlomRogue source package. + */ #include "cleanup.h" #include /* uint32_t */ #include /* free() */ #include /* unlink() */ #include "../common/readwrite.h" /* try_fclose() */ +#include "hardcoded_strings.h" /* s */ #include "thing_actions.h" /* free_thing_actions() */ #include "things.h" /* free_things(), free_thing_types() */ #include "world.h" /* global world */ @@ -19,13 +25,11 @@ static uint32_t cleanup_flags = 0x0000; extern void cleanup() { - char * f_name = "cleanup()"; free(world.queue); - free(world.log); free(world.map.cells); if (cleanup_flags & CLEANUP_WORLDSTATE) { - unlink(world.path_worldstate); + unlink(s[S_PATH_WORLDSTATE]); } if (cleanup_flags & CLEANUP_THINGS) { @@ -41,14 +45,14 @@ extern void cleanup() } if (cleanup_flags & CLEANUP_IN) { - try_fclose(world.file_in, f_name); - unlink(world.path_in); + try_fclose(world.file_in, __func__); + unlink(s[S_PATH_IN]); } if (cleanup_flags & CLEANUP_OUT) { - try_fclose(world.file_out, f_name); + try_fclose(world.file_out, __func__); free(world.server_test); - unlink(world.path_out); + unlink(s[S_PATH_OUT]); } }