Changeset - r6088:dd09788d020f
[Not reviewed]
master
0 4 0
Darkvater - 17 years ago 2007-02-20 09:46:10
darkvater@openttd.org
(svn r8823) -Fix (r8821): wrapping opendir to ottd-specific function failed on non-windows because this wrapper was only active for win32 (thx Rubidium)
4 files changed with 4 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/fios.cpp
Show inline comments
 
@@ -12,25 +12,24 @@
 
#include "functions.h"
 
#include "heightmap.h"
 
#include "helpers.hpp"
 
#include "table/strings.h"
 
#include "fios.h"
 
#include <sys/types.h>
 
#include <sys/stat.h>
 

	
 
#ifdef WIN32
 
# include <io.h>
 
#else
 
# include <unistd.h>
 
# include <dirent.h>
 
#endif /* WIN32 */
 

	
 
/* 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);
 
extern bool FiosIsValidFile(const char *path, const struct dirent *ent, struct stat *sb);
src/fios.h
Show inline comments
 
@@ -71,24 +71,28 @@ struct DIR {
 
	 * multiple independent opendir/readdir sequences must be supported. */
 
	dirent ent;
 
	WIN32_FIND_DATAW fd;
 
	/* since opendir calls FindFirstFile, we need a means of telling the
 
	 * first call to readdir that we already have a file.
 
	 * that's the case iff this is true */
 
	bool at_first_entry;
 
};
 

	
 
DIR *opendir(const wchar_t *path);
 
struct dirent *readdir(DIR *d);
 
int closedir(DIR *d);
 
#else
 
/* Use system-supplied opendir/readdir/closedir functions */
 
# include <sys/types.h>
 
# include <dirent.h>
 
#endif /* defined(WIN32) */
 

	
 
/**
 
 * A wrapper around opendir() which will convert the string from
 
 * OPENTTD encoding to that of the filesystem. For all purposes this
 
 * function behaves the same as the original opendir function
 
 * @param path string to open directory of
 
 * @return DIR pointer
 
 */
 
static inline DIR *ttd_opendir(const char *path)
 
{
 
	return opendir(OTTD2FS(path));
src/newgrf_config.cpp
Show inline comments
 
@@ -7,32 +7,28 @@
 
#include "debug.h"
 
#include "variables.h"
 
#include "string.h"
 
#include "saveload.h"
 
#include "md5.h"
 
#include "network/network_data.h"
 
#include "newgrf.h"
 
#include "newgrf_config.h"
 
#include "helpers.hpp"
 

	
 
#include "fileio.h"
 
#include "fios.h"
 
#include <sys/types.h>
 
#include <sys/stat.h>
 

	
 
#ifdef WIN32
 
# include <io.h>
 
#else
 
# include <unistd.h>
 
# include <dirent.h>
 
#endif /* WIN32 */
 

	
 

	
 
GRFConfig *_all_grfs;
 
GRFConfig *_grfconfig;
 
GRFConfig *_grfconfig_newgame;
 
GRFConfig *_grfconfig_static;
 

	
 

	
 
/* Calculate the MD5 Sum for a GRF */
 
static bool CalcGRFMD5Sum(GRFConfig *config)
 
{
src/strings.cpp
Show inline comments
 
@@ -15,31 +15,26 @@
 
#include "screenshot.h"
 
#include "waypoint.h"
 
#include "industry.h"
 
#include "variables.h"
 
#include "newgrf_text.h"
 
#include "table/landscape_const.h"
 
#include "table/control_codes.h"
 
#include "music.h"
 
#include "date.h"
 
#include "industry.h"
 
#include "helpers.hpp"
 

	
 
#ifdef WIN32
 
/* for opendir/readdir/closedir */
 
# include "fios.h"
 
#else
 
# include <sys/types.h>
 
# include <dirent.h>
 
#endif /* WIN32 */
 

	
 
char _userstring[128];
 

	
 
static char *StationGetSpecialString(char *buff, int x, const char* last);
 
static char *GetSpecialTownNameString(char *buff, int ind, uint32 seed, const char* last);
 
static char *GetSpecialPlayerNameString(char *buff, int ind, const int32 *argv, const char* last);
 

	
 
static char *FormatString(char *buff, const char *str, const int32 *argv, uint casei, const char* last);
 

	
 
typedef struct LanguagePack {
 
	uint32 ident;
 
	uint32 version;     // 32-bits of auto generated version info which is basically a hash of strings.h
0 comments (0 inline, 0 general)