author | sheepluva |
Mon, 08 Dec 2014 17:43:27 +0100 | |
changeset 10640 | efa069762cb2 |
parent 9991 | 3858d99476f5 |
child 13537 | ecdf6ce2301e |
permissions | -rw-r--r-- |
8074
768427321cab
thou shall not use system headers for crossplatformness
koda
parents:
8073
diff
changeset
|
1 |
#include "lua.h" |
768427321cab
thou shall not use system headers for crossplatformness
koda
parents:
8073
diff
changeset
|
2 |
#include "physfs.h" |
8034 | 3 |
|
9991 | 4 |
#include "physfscompat.h" |
5 |
||
8034 | 6 |
#define BUFSIZE 1024 |
7 |
||
8073 | 8 |
void *physfsReaderBuffer; |
8034 | 9 |
|
8119
257ffa847aa2
physfs: no carbon depency on osx, add cdecl attributes on extra functions
koda
parents:
8074
diff
changeset
|
10 |
PHYSFS_DECL const char * physfsReader(lua_State *L, PHYSFS_File *f, size_t *size) |
8034 | 11 |
{ |
12 |
||
13 |
if(PHYSFS_eof(f)) |
|
14 |
{ |
|
15 |
return NULL; |
|
16 |
} |
|
17 |
else |
|
18 |
{ |
|
19 |
*size = PHYSFS_readBytes(f, physfsReaderBuffer, BUFSIZE); |
|
20 |
||
21 |
if(*size == 0) |
|
22 |
return NULL; |
|
23 |
else |
|
24 |
return physfsReaderBuffer; |
|
25 |
} |
|
26 |
} |
|
8073 | 27 |
|
8119
257ffa847aa2
physfs: no carbon depency on osx, add cdecl attributes on extra functions
koda
parents:
8074
diff
changeset
|
28 |
PHYSFS_DECL void physfsReaderSetBuffer(void *buffer) |
8073 | 29 |
{ |
30 |
physfsReaderBuffer = buffer; |
|
8074
768427321cab
thou shall not use system headers for crossplatformness
koda
parents:
8073
diff
changeset
|
31 |
} |
768427321cab
thou shall not use system headers for crossplatformness
koda
parents:
8073
diff
changeset
|
32 |