#ifndef UNISTD_H #define UNISTD_H #include #ifndef SEEK_SET # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif #define S_IFDIR FILE_ATTRIBUTE_DIRECTORY //#ifndef _STAT_DEFINED struct stat { int st_mode; }; //#define _STAT_DEFINED //#endif typedef long off_t; int close (int fd); int open(const char *path, int mode); int open(const char *path, int access, unsigned mode); int read(int fd, void* buf, size_t count); int write(int fd, const void * buf, size_t count); off_t lseek(int fildes, off_t offset, int whence); int access(const char* path, int mode); int stat(const char *, struct stat *); const char* adaptpath(const char *path); //inline int __cdecl _mkdir (const char * dir) { return mkdir(dir); } //inline int __cdecl _unlink (const char * path) { return remove(path); } //#define _unlink remove #ifdef __cplusplus extern "C" { #endif int mkdir(const char *); int remove(const char *); int _mkdir(const char *); int _unlink(const char *); void rewind(FILE * file); FILE * fopen_wce (const char *, const char *); size_t fread_wce (void *, size_t, size_t, FILE *); size_t fwrite_wce (const void *, size_t, size_t, FILE *); int fclose_wce (FILE *); int fseek (FILE *, long, int); #ifdef __cplusplus }; #endif #define fopen fopen_wce #define fread fread_wce #define fwrite fwrite_wce #define fclose fclose_wce #define fseek fseek_wce #endif