static int DIR_exists(dvoid *opaque, const char *name) { char *f = __PHYSFS_platformCvtToDependent((char *) opaque, name, NULL); int retval; BAIL_IF_MACRO(f == NULL, NULL, 0); retval = __PHYSFS_platformExists(f); allocator.Free(f); return(retval); } /* DIR_exists */
static int DIR_exists(DirHandle *h, const char *name) { char *f = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name, NULL); int retval; BAIL_IF_MACRO(f == NULL, NULL, 0); retval = __PHYSFS_platformExists(f); free(f); return(retval); } /* DIR_exists */
static int DIR_isSymLink(dvoid *opaque, const char *name, int *fileExists) { char *f = __PHYSFS_platformCvtToDependent((char *) opaque, name, NULL); int retval = 0; BAIL_IF_MACRO(f == NULL, NULL, 0); *fileExists = __PHYSFS_platformExists(f); if (*fileExists) retval = __PHYSFS_platformIsSymLink(f); allocator.Free(f); return(retval); } /* DIR_isSymLink */
static int DIR_isDirectory(dvoid *opaque, const char *name, int *fileExists) { char *d = __PHYSFS_platformCvtToDependent((char *) opaque, name, NULL); int retval = 0; BAIL_IF_MACRO(d == NULL, NULL, 0); *fileExists = __PHYSFS_platformExists(d); if (*fileExists) retval = __PHYSFS_platformIsDirectory(d); allocator.Free(d); return(retval); } /* DIR_isDirectory */
static int DIR_isSymLink(DirHandle *h, const char *name, int *fileExists) { char *f = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name, NULL); int retval = 0; BAIL_IF_MACRO(f == NULL, NULL, 0); *fileExists = __PHYSFS_platformExists(f); if (*fileExists) retval = __PHYSFS_platformIsSymLink(f); free(f); return(retval); } /* DIR_isSymLink */
static int DIR_isDirectory(DirHandle *h, const char *name, int *fileExists) { char *d = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name, NULL); int retval = 0; BAIL_IF_MACRO(d == NULL, NULL, 0); *fileExists = __PHYSFS_platformExists(d); if (*fileExists) retval = __PHYSFS_platformIsDirectory(d); free(d); return(retval); } /* DIR_isDirectory */
static PHYSFS_sint64 DIR_getLastModTime(dvoid *opaque, const char *name, int *fileExists) { char *d = __PHYSFS_platformCvtToDependent((char *) opaque, name, NULL); PHYSFS_sint64 retval = -1; BAIL_IF_MACRO(d == NULL, NULL, 0); *fileExists = __PHYSFS_platformExists(d); if (*fileExists) retval = __PHYSFS_platformGetLastModTime(d); allocator.Free(d); return(retval); } /* DIR_getLastModTime */
static PHYSFS_sint64 DIR_getLastModTime(DirHandle *h, const char *name, int *fileExists) { char *d = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name, NULL); PHYSFS_sint64 retval = -1; BAIL_IF_MACRO(d == NULL, NULL, 0); *fileExists = __PHYSFS_platformExists(d); if (*fileExists) retval = __PHYSFS_platformGetLastModTime(d); free(d); return(retval); } /* DIR_getLastModTime */
static FileHandle *doOpen(DirHandle *h, const char *name, void *(*openFunc)(const char *filename), int *fileExists, const FileFunctions *fileFuncs) { char *f = __PHYSFS_platformCvtToDependent((char *)(h->opaque), name, NULL); void *rc; FileHandle *retval; BAIL_IF_MACRO(f == NULL, NULL, NULL); if (fileExists != NULL) { *fileExists = __PHYSFS_platformExists(f); if (!(*fileExists)) { free(f); return(NULL); } /* if */ } /* if */ retval = (FileHandle *) malloc(sizeof (FileHandle)); if (!retval) { free(f); BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL); } /* if */ rc = openFunc(f); free(f); if (!rc) { free(retval); return(NULL); } /* if */ retval->opaque = (void *) rc; retval->dirHandle = h; retval->funcs = fileFuncs; return(retval); } /* doOpen */
static fvoid *doOpen(dvoid *opaque, const char *name, void *(*openFunc)(const char *filename), int *fileExists) { char *f = __PHYSFS_platformCvtToDependent((char *) opaque, name, NULL); void *rc = NULL; BAIL_IF_MACRO(f == NULL, NULL, NULL); if (fileExists != NULL) { *fileExists = __PHYSFS_platformExists(f); if (!(*fileExists)) { allocator.Free(f); return(NULL); } /* if */ } /* if */ rc = openFunc(f); allocator.Free(f); return((fvoid *) rc); } /* doOpen */
bool ex_os_isfile ( const char *_path ) { if ( __PHYSFS_platformExists(_path) == false ) { return false; } return (__PHYSFS_platformIsSymLink(_path) || __PHYSFS_platformIsDirectory(_path)) ? false : true; }
bool ex_os_exists ( const char *_path ) { return __PHYSFS_platformExists(_path); }