src/fios.h
changeset 6179 d19b0137d8e4
parent 6088 f1149b4ff932
child 6247 7d81e3a5d803
equal deleted inserted replaced
6178:c29a7d37c3ce 6179:d19b0137d8e4
     1 /* $Id$ */
     1 /* $Id$ */
       
     2 
       
     3 /** @file fios.h Declarations for savegames operations */
     2 
     4 
     3 #ifndef FIOS_H
     5 #ifndef FIOS_H
     4 #define FIOS_H
     6 #define FIOS_H
     5 
     7 
     6 /* Deals with finding savegames */
     8 /* Deals with finding savegames */
    24 	FIOS_TYPE_BMP          =   9,
    26 	FIOS_TYPE_BMP          =   9,
    25 	FIOS_TYPE_INVALID      = 255,
    27 	FIOS_TYPE_INVALID      = 255,
    26 };
    28 };
    27 
    29 
    28 /* Variables to display file lists */
    30 /* Variables to display file lists */
    29 extern FiosItem *_fios_list; // defined in misc_gui.c
    31 extern FiosItem *_fios_list; ///< defined in misc_gui.cpp
    30 extern int _fios_num;        // defined in fios.c, read_only version of _fios_count
    32 extern int _fios_num;        ///< defined in fios.cpp, read_only version of _fios_count
    31 extern int _saveload_mode;   // defined in misc_gui.c
    33 extern int _saveload_mode;   ///< defined in misc_gui.cpp
    32 
    34 
    33 // Get a list of savegames
    35 /* Get a list of savegames */
    34 FiosItem *FiosGetSavegameList(int mode);
    36 FiosItem *FiosGetSavegameList(int mode);
    35 // Get a list of scenarios
    37 /* Get a list of scenarios */
    36 FiosItem *FiosGetScenarioList(int mode);
    38 FiosItem *FiosGetScenarioList(int mode);
    37 // Get a list of Heightmaps
    39 /* Get a list of Heightmaps */
    38 FiosItem *FiosGetHeightmapList(int mode);
    40 FiosItem *FiosGetHeightmapList(int mode);
    39 // Free the list of savegames
    41 /* Free the list of savegames */
    40 void FiosFreeSavegameList(void);
    42 void FiosFreeSavegameList(void);
    41 // Browse to. Returns a filename w/path if we reached a file.
    43 /* Browse to. Returns a filename w/path if we reached a file. */
    42 char *FiosBrowseTo(const FiosItem *item);
    44 char *FiosBrowseTo(const FiosItem *item);
    43 // Return path, free space and stringID
    45 /* Return path, free space and stringID */
    44 StringID FiosGetDescText(const char **path, uint32 *total_free);
    46 StringID FiosGetDescText(const char **path, uint32 *total_free);
    45 // Delete a name
    47 /* Delete a name */
    46 bool FiosDelete(const char *name);
    48 bool FiosDelete(const char *name);
    47 // Make a filename from a name
    49 /* Make a filename from a name */
    48 void FiosMakeSavegameName(char *buf, const char *name, size_t size);
    50 void FiosMakeSavegameName(char *buf, const char *name, size_t size);
    49 // Allocate a new FiosItem
    51 /* Allocate a new FiosItem */
    50 FiosItem *FiosAlloc(void);
    52 FiosItem *FiosAlloc(void);
    51 
    53 
    52 int CDECL compare_FiosItems(const void *a, const void *b);
    54 int CDECL compare_FiosItems(const void *a, const void *b);
    53 
    55 
    54 /* Implementation of opendir/readdir/closedir for Windows */
    56 /* Implementation of opendir/readdir/closedir for Windows */
    55 #if defined(WIN32)
    57 #if defined(WIN32)
    56 #include <windows.h>
    58 #include <windows.h>
    57 typedef struct DIR DIR;
    59 typedef struct DIR DIR;
    58 
    60 
    59 typedef struct dirent { // XXX - only d_name implemented
    61 typedef struct dirent { // XXX - only d_name implemented
    60 	wchar_t *d_name; /* name of found file */
    62 	wchar_t *d_name; // name of found file
    61 	/* little hack which will point to parent DIR struct which will
    63 	/* little hack which will point to parent DIR struct which will
    62 	 * save us a call to GetFileAttributes if we want information
    64 	 * save us a call to GetFileAttributes if we want information
    63 	 * about the file (for example in function fio_bla */
    65 	 * about the file (for example in function fio_bla) */
    64 	DIR *dir;
    66 	DIR *dir;
    65 } dirent;
    67 } dirent;
    66 
    68 
    67 struct DIR {
    69 struct DIR {
    68 	HANDLE hFind;
    70 	HANDLE hFind;