added function to get temporary tape filename
authorHolger Schemel <info@artsoft.org>
Mon, 23 Aug 2021 10:16:58 +0000 (12:16 +0200)
committerHolger Schemel <info@artsoft.org>
Mon, 23 Aug 2021 10:16:58 +0000 (12:16 +0200)
src/libgame/setup.c
src/libgame/setup.h

index 48f967c3b03ee2ff5688501294efc178d3174e25..bda89ee3222c63f3c747f244144f2a43ecef89e0 100644 (file)
@@ -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;
index 056e0bbb26a87c5b454f810eb979385debf059c5..4e68c5969785e0323d4b401efea1daf8bac026ad 100644 (file)
@@ -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);