summaryrefslogtreecommitdiff
path: root/fios.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-08-05 00:59:45 +0000
committerDarkvater <darkvater@openttd.org>2006-08-05 00:59:45 +0000
commita9251d2d02a17467343284442ee6857012e27c31 (patch)
tree6c1c325e24d7182ffd6868b3118786d9a3bcf41d /fios.c
parent198f6caf20bf425bd1d3c8b91291f58213f6b60b (diff)
downloadopenttd-a9251d2d02a17467343284442ee6857012e27c31.tar.xz
(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
Diffstat (limited to 'fios.c')
-rw-r--r--fios.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/fios.c b/fios.c
index b40eb0f26..1b1c1af2a 100644
--- a/fios.c
+++ b/fios.c
@@ -11,7 +11,6 @@
#include "variables.h"
#include "functions.h"
#include "table/strings.h"
-#include "hal.h"
#include "fios.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -23,9 +22,12 @@
# include <dirent.h>
#endif /* WIN32 */
-char *_fios_path;
-FiosItem *_fios_items;
-int _fios_count, _fios_alloc;
+/* Variables to display file lists */
+int _fios_num;
+
+static char *_fios_path;
+static FiosItem *_fios_items;
+static int _fios_count, _fios_alloc;
/* OS-specific functions are taken from their respective files (win32/unix/os2 .c) */
extern bool FiosIsRoot(const char *path);
@@ -184,7 +186,7 @@ typedef byte fios_getlist_callback_proc(int mode, const char *filename, const ch
* @param mode The mode we are in. Some modes don't allow 'parent'.
* @param callback The function that is called where you need to do the filtering.
* @return Return the list of files. */
-static FiosItem *FiosGetFileList(int *num, int mode, fios_getlist_callback_proc *callback_proc)
+static FiosItem *FiosGetFileList(int mode, fios_getlist_callback_proc *callback_proc)
{
struct stat sb;
struct dirent *dirent;
@@ -265,7 +267,7 @@ static FiosItem *FiosGetFileList(int *num, int mode, fios_getlist_callback_proc
/* Show drives */
if (mode != SLD_NEW_GAME) FiosGetDrives();
- *num = _fios_count;
+ _fios_num = _fios_count;
return _fios_items;
}
@@ -305,7 +307,7 @@ static byte FiosGetSavegameListCallback(int mode, const char *file, const char *
* @return A pointer to an array of FiosItem representing all the files to be shown in the save/load dialog.
* @see FiosGetFileList
*/
-FiosItem *FiosGetSavegameList(int *num, int mode)
+FiosItem *FiosGetSavegameList(int mode)
{
static char *_fios_save_path = NULL;
@@ -316,7 +318,7 @@ FiosItem *FiosGetSavegameList(int *num, int mode)
_fios_path = _fios_save_path;
- return FiosGetFileList(num, mode, &FiosGetSavegameListCallback);
+ return FiosGetFileList(mode, &FiosGetSavegameListCallback);
}
/**
@@ -353,7 +355,7 @@ static byte FiosGetScenarioListCallback(int mode, const char *file, const char *
* @return A pointer to an array of FiosItem representing all the files to be shown in the save/load dialog.
* @see FiosGetFileList
*/
-FiosItem *FiosGetScenarioList(int *num, int mode)
+FiosItem *FiosGetScenarioList(int mode)
{
static char *_fios_scn_path = NULL;
@@ -364,5 +366,5 @@ FiosItem *FiosGetScenarioList(int *num, int mode)
_fios_path = _fios_scn_path;
- return FiosGetFileList(num, mode, &FiosGetScenarioListCallback);
+ return FiosGetFileList(mode, &FiosGetScenarioListCallback);
}