src/fios.cpp
changeset 6247 7d81e3a5d803
parent 6240 9d9874ef9f0b
child 6251 2ad87f850eb9
equal deleted inserted replaced
6246:75451000349d 6247:7d81e3a5d803
    32 
    32 
    33 /* OS-specific functions are taken from their respective files (win32/unix/os2 .c) */
    33 /* OS-specific functions are taken from their respective files (win32/unix/os2 .c) */
    34 extern bool FiosIsRoot(const char *path);
    34 extern bool FiosIsRoot(const char *path);
    35 extern bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb);
    35 extern bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb);
    36 extern bool FiosIsHiddenFile(const struct dirent *ent);
    36 extern bool FiosIsHiddenFile(const struct dirent *ent);
    37 extern void FiosGetDrives(void);
    37 extern void FiosGetDrives();
    38 extern bool FiosGetDiskFreeSpace(const char *path, uint32 *tot);
    38 extern bool FiosGetDiskFreeSpace(const char *path, uint32 *tot);
    39 
    39 
    40 /* get the name of an oldstyle savegame */
    40 /* get the name of an oldstyle savegame */
    41 extern void GetOldSaveGameName(char *title, const char *path, const char *file);
    41 extern void GetOldSaveGameName(char *title, const char *path, const char *file);
    42 
    42 
    43 /**
    43 /**
    44  * Allocate a new FiosItem.
    44  * Allocate a new FiosItem.
    45  * @return A pointer to the newly allocated FiosItem.
    45  * @return A pointer to the newly allocated FiosItem.
    46  */
    46  */
    47 FiosItem *FiosAlloc(void)
    47 FiosItem *FiosAlloc()
    48 {
    48 {
    49 	if (_fios_count == _fios_alloc) {
    49 	if (_fios_count == _fios_alloc) {
    50 		_fios_alloc += 256;
    50 		_fios_alloc += 256;
    51 		_fios_items = ReallocT(_fios_items, _fios_alloc);
    51 		_fios_items = ReallocT(_fios_items, _fios_alloc);
    52 	}
    52 	}
    76 }
    76 }
    77 
    77 
    78 /**
    78 /**
    79  * Free the list of savegames
    79  * Free the list of savegames
    80  */
    80  */
    81 void FiosFreeSavegameList(void)
    81 void FiosFreeSavegameList()
    82 {
    82 {
    83 	free(_fios_items);
    83 	free(_fios_items);
    84 	_fios_items = NULL;
    84 	_fios_items = NULL;
    85 	_fios_alloc = _fios_count = 0;
    85 	_fios_alloc = _fios_count = 0;
    86 }
    86 }