From: Holger Schemel Date: Mon, 23 Aug 2021 10:16:58 +0000 (+0200) Subject: added function to get temporary tape filename X-Git-Tag: 4.3.0.0~89 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=aeab04175be270699cc23606f3e28142c5b60f6c;p=rocksndiamonds.git added function to get temporary tape filename --- diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 48f967c3..bda89ee3 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -582,6 +582,19 @@ char *getTapeFilename(int nr) return filename; } +char *getTemporaryTapeFilename(void) +{ + static char *filename = NULL; + char basename[MAX_FILENAME_LEN]; + + checked_free(filename); + + sprintf(basename, "tmp.%s", TAPEFILE_EXTENSION); + filename = getPath2(getTapeDir(NULL), basename); + + return filename; +} + char *getDefaultSolutionTapeFilename(int nr) { static char *filename = NULL; diff --git a/src/libgame/setup.h b/src/libgame/setup.h index 056e0bbb..4e68c596 100644 --- a/src/libgame/setup.h +++ b/src/libgame/setup.h @@ -264,6 +264,7 @@ char *setLevelArtworkDir(TreeInfo *); char *getProgramMainDataPath(char *, char *); char *getProgramConfigFilename(char *); char *getTapeFilename(int); +char *getTemporaryTapeFilename(void); char *getDefaultSolutionTapeFilename(int); char *getSokobanSolutionTapeFilename(int); char *getSolutionTapeFilename(int);