author | koda |
Mon, 19 Nov 2012 02:48:21 +0100 | |
changeset 8064 | 202e2cce7077 |
parent 8040 | 448d61778ca7 |
child 8073 | 5a289ef40fdb |
permissions | -rw-r--r-- |
#include <lua.h> #include <physfs.h> #define BUFSIZE 1024 void * physfsReaderBuffer; const char * physfsReader(lua_State *L, PHYSFS_File *f, size_t *size) { if(PHYSFS_eof(f)) { return NULL; } else { *size = PHYSFS_readBytes(f, physfsReaderBuffer, BUFSIZE); if(*size == 0) return NULL; else return physfsReaderBuffer; } }