fios.h
author glx
Mon, 24 Sep 2007 03:08:47 +0000
branch0.5
changeset 5545 f42dc59a45f5
parent 5472 16f71955fc3b
permissions -rw-r--r--
(svn r11153) [0.5] -Fix [FS#1251]: incorrect usage of {G} tag in slovak translation
4218
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
     1
/* $Id$ */
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
     2
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
     3
#ifndef FIOS_H
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
     4
#define FIOS_H
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
     5
4223
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
     6
/* Deals with finding savegames */
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
     7
typedef struct {
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
     8
	byte type;
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
     9
	uint64 mtime;
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    10
	char title[64];
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    11
	char name[256 - 12 - 64];
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    12
} FiosItem;
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    13
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    14
enum {
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4300
diff changeset
    15
	FIOS_TYPE_DRIVE        =   0,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4300
diff changeset
    16
	FIOS_TYPE_PARENT       =   1,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4300
diff changeset
    17
	FIOS_TYPE_DIR          =   2,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4300
diff changeset
    18
	FIOS_TYPE_FILE         =   3,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4300
diff changeset
    19
	FIOS_TYPE_OLDFILE      =   4,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4300
diff changeset
    20
	FIOS_TYPE_SCENARIO     =   5,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4300
diff changeset
    21
	FIOS_TYPE_OLD_SCENARIO =   6,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4300
diff changeset
    22
	FIOS_TYPE_DIRECT       =   7,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4300
diff changeset
    23
	FIOS_TYPE_PNG          =   8,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4300
diff changeset
    24
	FIOS_TYPE_BMP          =   9,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 4300
diff changeset
    25
	FIOS_TYPE_INVALID      = 255,
4223
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    26
};
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    27
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    28
/* Variables to display file lists */
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    29
extern FiosItem *_fios_list; // defined in misc_gui.c
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    30
extern int _fios_num;        // defined in fios.c, read_only version of _fios_count
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    31
extern int _saveload_mode;   // defined in misc_gui.c
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    32
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    33
// Get a list of savegames
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    34
FiosItem *FiosGetSavegameList(int mode);
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    35
// Get a list of scenarios
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    36
FiosItem *FiosGetScenarioList(int mode);
4300
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4223
diff changeset
    37
// Get a list of Heightmaps
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4223
diff changeset
    38
FiosItem *FiosGetHeightmapList(int mode);
4223
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    39
// Free the list of savegames
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    40
void FiosFreeSavegameList(void);
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    41
// Browse to. Returns a filename w/path if we reached a file.
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    42
char *FiosBrowseTo(const FiosItem *item);
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    43
// Return path, free space and stringID
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    44
StringID FiosGetDescText(const char **path, uint32 *total_free);
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    45
// Delete a name
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    46
bool FiosDelete(const char *name);
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    47
// Make a filename from a name
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    48
void FiosMakeSavegameName(char *buf, const char *name, size_t size);
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    49
// Allocate a new FiosItem
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    50
FiosItem *FiosAlloc(void);
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    51
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    52
int CDECL compare_FiosItems(const void *a, const void *b);
0f9535dda7ed (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
Darkvater
parents: 4218
diff changeset
    53
4218
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    54
/* Implementation of opendir/readdir/closedir for Windows */
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    55
#if defined(WIN32)
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    56
#include <windows.h>
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    57
typedef struct DIR DIR;
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    58
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    59
typedef struct dirent { // XXX - only d_name implemented
5472
16f71955fc3b (svn r9358) [0.5] -Backport from trunk (r9055, r9082, r9083, r9084, r9085, r9086):
glx
parents: 5444
diff changeset
    60
	TCHAR *d_name; /* name of found file */
4218
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    61
	/* little hack which will point to parent DIR struct which will
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    62
	 * save us a call to GetFileAttributes if we want information
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    63
	 * about the file (for example in function fio_bla */
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    64
	DIR *dir;
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    65
} dirent;
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    66
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    67
struct DIR {
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    68
	HANDLE hFind;
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    69
	/* the dirent returned by readdir.
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    70
	 * note: having only one global instance is not possible because
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    71
	 * multiple independent opendir/readdir sequences must be supported. */
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    72
	dirent ent;
5472
16f71955fc3b (svn r9358) [0.5] -Backport from trunk (r9055, r9082, r9083, r9084, r9085, r9086):
glx
parents: 5444
diff changeset
    73
	WIN32_FIND_DATA fd;
4218
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    74
	/* since opendir calls FindFirstFile, we need a means of telling the
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    75
	 * first call to readdir that we already have a file.
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    76
	 * that's the case iff this is true */
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    77
	bool at_first_entry;
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    78
};
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    79
5472
16f71955fc3b (svn r9358) [0.5] -Backport from trunk (r9055, r9082, r9083, r9084, r9085, r9086):
glx
parents: 5444
diff changeset
    80
DIR *opendir(const TCHAR *path);
4218
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    81
struct dirent *readdir(DIR *d);
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    82
int closedir(DIR *d);
5444
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    83
#else
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    84
/* Use system-supplied opendir/readdir/closedir functions */
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    85
# include <sys/types.h>
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    86
# include <dirent.h>
4218
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    87
#endif /* defined(WIN32) */
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
    88
5444
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    89
/**
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    90
 * A wrapper around opendir() which will convert the string from
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    91
 * OPENTTD encoding to that of the filesystem. For all purposes this
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    92
 * function behaves the same as the original opendir function
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    93
 * @param path string to open directory of
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    94
 * @return DIR pointer
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    95
 */
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    96
static inline DIR *ttd_opendir(const char *path)
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    97
{
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    98
	return opendir(OTTD2FS(path));
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
    99
}
3209bb62403e (svn r8872) [0.5] -Backport from trunk (r8784, r8821, r8823, r8824):
Darkvater
parents: 5167
diff changeset
   100
4218
384c7451e3bb (svn r5762) - Codechange: Implementation of POSIX-style opendir/readdir/closedir functions for windows using FindFirstFile/FindNextFile/FindClose.
Darkvater
parents:
diff changeset
   101
#endif /* FIOS_H */