diff options
Diffstat (limited to 'src/gfile/gfile_fs_native.c')
-rw-r--r-- | src/gfile/gfile_fs_native.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/gfile/gfile_fs_native.c b/src/gfile/gfile_fs_native.c index d1e2a1fc..a9bc5065 100644 --- a/src/gfile/gfile_fs_native.c +++ b/src/gfile/gfile_fs_native.c @@ -22,19 +22,19 @@ #include <sys/types.h> #include <sys/stat.h> -static bool_t NativeDel(const char *fname); -static bool_t NativeExists(const char *fname); +static gBool NativeDel(const char *fname); +static gBool NativeExists(const char *fname); static long int NativeFilesize(const char *fname); -static bool_t NativeRen(const char *oldname, const char *newname); -static bool_t NativeOpen(GFILE *f, const char *fname); +static gBool NativeRen(const char *oldname, const char *newname); +static gBool NativeOpen(GFILE *f, const char *fname); static void NativeClose(GFILE *f); static int NativeRead(GFILE *f, void *buf, int size); static int NativeWrite(GFILE *f, const void *buf, int size); -static bool_t NativeSetpos(GFILE *f, long int pos); +static gBool NativeSetpos(GFILE *f, long int pos); static long int NativeGetsize(GFILE *f); -static bool_t NativeEof(GFILE *f); +static gBool NativeEof(GFILE *f); #if GFILE_NEED_FILELISTS - static gfileList *NativeFlOpen(const char *path, bool_t dirs); + static gfileList *NativeFlOpen(const char *path, gBool dirs); static const char *NativeFlRead(gfileList *pfl); static void NativeFlClose(gfileList *pfl); #endif @@ -95,33 +95,33 @@ static void Native_flags2mode(char *buf, uint16_t flags) { *buf++ = 0; } -static bool_t NativeDel(const char *fname) { return remove(fname) ? FALSE : TRUE; } +static gBool NativeDel(const char *fname) { return remove(fname) ? gFalse : gTrue; } static void NativeClose(GFILE *f) { fclose((FILE *)f->obj); } static int NativeRead(GFILE *f, void *buf, int size) { return fread(buf, 1, size, (FILE *)f->obj); } static int NativeWrite(GFILE *f, const void *buf, int size) { return fwrite(buf, 1, size, (FILE *)f->obj); } -static bool_t NativeSetpos(GFILE *f, long int pos) { return fseek((FILE *)f->obj, pos, SEEK_SET) ? FALSE : TRUE; } -static bool_t NativeEof(GFILE *f) { return feof((FILE *)f->obj) ? TRUE : FALSE; } -static bool_t NativeRen(const char *oldname, const char *newname) { return rename(oldname, newname) ? FALSE : TRUE; } -static bool_t NativeExists(const char *fname) { +static gBool NativeSetpos(GFILE *f, long int pos) { return fseek((FILE *)f->obj, pos, SEEK_SET) ? gFalse : gTrue; } +static gBool NativeEof(GFILE *f) { return feof((FILE *)f->obj) ? gTrue : gFalse; } +static gBool NativeRen(const char *oldname, const char *newname) { return rename(oldname, newname) ? gFalse : gTrue; } +static gBool NativeExists(const char *fname) { // We define access this way so we don't have to include <unistd.h> which may // (and does under windows) contain conflicting definitions for types such as uint16_t. extern int access(const char *pathname, int mode); - return access(fname, 0) ? FALSE : TRUE; + return access(fname, 0) ? gFalse : gTrue; } static long int NativeFilesize(const char *fname) { struct stat st; if (stat(fname, &st)) return -1; return st.st_size; } -static bool_t NativeOpen(GFILE *f, const char *fname) { +static gBool NativeOpen(GFILE *f, const char *fname) { FILE *fd; char mode[5]; Native_flags2mode(mode, f->flags); if (!(fd = fopen(fname, mode))) - return FALSE; + return gFalse; f->obj = (void *)fd; - return TRUE; + return gTrue; } static long int NativeGetsize(GFILE *f) { struct stat st; @@ -135,10 +135,10 @@ static long int NativeGetsize(GFILE *f) { gfileList fl; HANDLE d; WIN32_FIND_DATA f; - bool_t first; + gBool first; } NativeFileList; - static gfileList *NativeFlOpen(const char *path, bool_t dirs) { + static gfileList *NativeFlOpen(const char *path, gBool dirs) { NativeFileList *p; (void) dirs; @@ -148,7 +148,7 @@ static long int NativeGetsize(GFILE *f) { gfxFree(p); return 0; } - p->first = TRUE; + p->first = gTrue; return &p->fl; } @@ -157,7 +157,7 @@ static long int NativeGetsize(GFILE *f) { while(1) { if (!nfl->first && !FindNextFile(nfl->d, &nfl->f)) return 0; - nfl->first = FALSE; + nfl->first = gFalse; if (nfl->f.cFileName[0] == '.') continue; if (nfl->fl.dirs) { @@ -186,7 +186,7 @@ static long int NativeGetsize(GFILE *f) { struct dirent * f; } NativeFileList; - static gfileList *NativeFlOpen(const char *path, bool_t dirs) { + static gfileList *NativeFlOpen(const char *path, gBool dirs) { NativeFileList *p; (void) dirs; |