VFILE *vfopen(const char *fn, const char *mode) { if (strchr(mode, 'w')) { fprintf(stderr, "FileAPI.h: File writing via VFS not yet supported!"); return NULL; } VFILE *vf = vfs.GetFile(fn); if (!vf || !vf->open(mode)) return NULL; ++(vf->ref); // keep the file alive until closed. return vf; }
VFILE *vfopen(const char *fn, const char *mode) { if (strchr(mode, 'w')) { assert(0 && "ttvfs_stdio: File writing via VFS not yet supported!"); return NULL; } VFILE *vf = vfs->GetFile(fn); if (!vf || !vf->open(mode)) return NULL; vf->incref(); // keep the file alive until closed. return vf; }