--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/physfs/extras/physfslualoader.c Sat Nov 17 00:01:06 2012 +0400
@@ -0,0 +1,24 @@
+#include <lua51/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;
+ }
+}