andre@3: andre@3: /* --------------------------------------------------------------------------- andre@3: Stuff to fake unix file I/O on windows boxes andre@3: ------------------------------------------------------------------------*/ andre@3: andre@3: #ifndef WINFILE_H andre@3: #define WINFILE_H andre@3: andre@3: #ifdef _WINDOWS andre@3: /* hacked out of on an SGI */ andre@3: #if defined(XP_WIN32) || defined(_WIN32) andre@3: /* 32-bit stuff here */ andre@3: #include andre@3: #include andre@3: #ifdef __MINGW32__ andre@3: #include andre@3: #include andre@3: #else andre@3: #include andre@3: #include andre@3: #endif andre@3: andre@3: typedef struct DIR_Struct { andre@3: void * directoryPtr; andre@3: WIN32_FIND_DATA data; andre@3: } DIR; andre@3: andre@3: #define _ST_FSTYPSZ 16 andre@3: andre@3: #if !defined(__BORLANDC__) && !defined(__GNUC__) andre@3: typedef unsigned long mode_t; andre@3: typedef long uid_t; andre@3: typedef long gid_t; andre@3: typedef long off_t; andre@3: typedef unsigned long nlink_t; andre@3: #endif andre@3: andre@3: typedef struct timestruc { andre@3: time_t tv_sec; /* seconds */ andre@3: long tv_nsec; /* and nanoseconds */ andre@3: } timestruc_t; andre@3: andre@3: andre@3: struct dirent { /* data from readdir() */ andre@3: ino_t d_ino; /* inode number of entry */ andre@3: off_t d_off; /* offset of disk direntory entry */ andre@3: unsigned short d_reclen; /* length of this record */ andre@3: char d_name[_MAX_FNAME]; /* name of file */ andre@3: }; andre@3: andre@3: #if !defined(__BORLANDC__) && !defined (__GNUC__) andre@3: #define S_ISDIR(s) ((s) & _S_IFDIR) andre@3: #endif andre@3: andre@3: #else /* _WIN32 */ andre@3: /* 16-bit windows stuff */ andre@3: andre@3: #include andre@3: #include andre@3: #include andre@3: andre@3: andre@3: andre@3: /* Getting cocky to support multiple file systems */ andre@3: typedef struct dirStruct_tag { andre@3: struct _find_t file_data; andre@3: char c_checkdrive; andre@3: } dirStruct; andre@3: andre@3: typedef struct DIR_Struct { andre@3: void * directoryPtr; andre@3: dirStruct data; andre@3: } DIR; andre@3: andre@3: #define _ST_FSTYPSZ 16 andre@3: typedef unsigned long mode_t; andre@3: typedef long uid_t; andre@3: typedef long gid_t; andre@3: typedef long off_t; andre@3: typedef unsigned long nlink_t; andre@3: andre@3: typedef struct timestruc { andre@3: time_t tv_sec; /* seconds */ andre@3: long tv_nsec; /* and nanoseconds */ andre@3: } timestruc_t; andre@3: andre@3: struct dirent { /* data from readdir() */ andre@3: ino_t d_ino; /* inode number of entry */ andre@3: off_t d_off; /* offset of disk direntory entry */ andre@3: unsigned short d_reclen; /* length of this record */ andre@3: #ifdef XP_WIN32 andre@3: char d_name[_MAX_FNAME]; /* name of file */ andre@3: #else andre@3: char d_name[20]; /* name of file */ andre@3: #endif andre@3: }; andre@3: andre@3: #define S_ISDIR(s) ((s) & _S_IFDIR) andre@3: andre@3: #endif /* 16-bit windows */ andre@3: andre@3: #define CONST const andre@3: andre@3: #endif /* _WINDOWS */ andre@3: andre@3: #endif /* WINFILE_H */