From a9251d2d02a17467343284442ee6857012e27c31 Mon Sep 17 00:00:00 2001 From: Darkvater Date: Sat, 5 Aug 2006 00:59:45 +0000 Subject: (svn r5767) - Cleanup: Improve upon the header file mess regarding fios. Move all relevant types from hal.h into fios.h, eliminate the unneccessary passing of a global variable, and extern variables in header files (declare in fios.c and misc_gui.c --- fios.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'fios.h') diff --git a/fios.h b/fios.h index 76c63b99c..5b29c40b6 100644 --- a/fios.h +++ b/fios.h @@ -3,6 +3,50 @@ #ifndef FIOS_H #define FIOS_H +/* Deals with finding savegames */ +typedef struct { + byte type; + uint64 mtime; + char title[64]; + char name[256 - 12 - 64]; +} FiosItem; + +enum { + FIOS_TYPE_DRIVE = 0, + FIOS_TYPE_PARENT = 1, + FIOS_TYPE_DIR = 2, + FIOS_TYPE_FILE = 3, + FIOS_TYPE_OLDFILE = 4, + FIOS_TYPE_SCENARIO = 5, + FIOS_TYPE_OLD_SCENARIO = 6, + FIOS_TYPE_DIRECT = 7, + FIOS_TYPE_INVALID = 255, +}; + +/* Variables to display file lists */ +extern FiosItem *_fios_list; // defined in misc_gui.c +extern int _fios_num; // defined in fios.c, read_only version of _fios_count +extern int _saveload_mode; // defined in misc_gui.c + +// Get a list of savegames +FiosItem *FiosGetSavegameList(int mode); +// Get a list of scenarios +FiosItem *FiosGetScenarioList(int mode); +// Free the list of savegames +void FiosFreeSavegameList(void); +// Browse to. Returns a filename w/path if we reached a file. +char *FiosBrowseTo(const FiosItem *item); +// Return path, free space and stringID +StringID FiosGetDescText(const char **path, uint32 *total_free); +// Delete a name +bool FiosDelete(const char *name); +// Make a filename from a name +void FiosMakeSavegameName(char *buf, const char *name, size_t size); +// Allocate a new FiosItem +FiosItem *FiosAlloc(void); + +int CDECL compare_FiosItems(const void *a, const void *b); + /* Implementation of opendir/readdir/closedir for Windows */ #if defined(WIN32) #include -- cgit v1.2.3-54-g00ecf