Add buildvfs, abstraction layer for file I/O.

Currently it passes calls through to the system libraries as before.

Also adds an incomplete implementation on PhysFS.

git-svn-id: https://svn.eduke32.com/eduke32@7359 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-03-01 08:51:50 +00:00
parent 5c9b921285
commit 7414f29348
78 changed files with 1108 additions and 991 deletions

View file

@ -11,6 +11,8 @@
#include "compat.h"
#include "cache1d.h"
#include "vfs.h"
#define ISWS(x) ((x == ' ') || (x == '\t') || (x == '\r') || (x == '\n'))
static inline void skipoverws(scriptfile *sf) { if ((sf->textptr < sf->eof) && (!sf->textptr[0])) sf->textptr++; }
@ -299,8 +301,8 @@ void scriptfile_preparse(scriptfile *sf, char *tx, int32_t flen)
scriptfile *scriptfile_fromfile(const char *fn)
{
int32_t fp = kopen4load(fn, 0);
if (fp < 0) return nullptr;
buildvfs_kfd fp = kopen4load(fn, 0);
if (fp == buildvfs_kfd_invalid) return nullptr;
uint32_t flen = kfilelength(fp);
char * tx = (char *)Xmalloc(flen + 2);