diff options
author | Emil Renner Berthing <esmil@mailme.dk> | 2016-01-07 22:39:28 +0100 |
---|---|---|
committer | Emil Renner Berthing <esmil@mailme.dk> | 2016-01-08 00:20:13 +0100 |
commit | 4c0ad860e7710b8cecaa13b96dfc6bdb8d6a14ea (patch) | |
tree | 089aff1638d71783695571cdae7cbf026277b5eb /lua/lzio.h | |
parent | e005effffa9b69bb1a93a8031308700ae8e4a857 (diff) | |
download | lem-4c0ad860e7710b8cecaa13b96dfc6bdb8d6a14ea.tar.gz lem-4c0ad860e7710b8cecaa13b96dfc6bdb8d6a14ea.tar.xz lem-4c0ad860e7710b8cecaa13b96dfc6bdb8d6a14ea.zip |
Lua 5.3.2
Diffstat (limited to 'lua/lzio.h')
-rw-r--r-- | lua/lzio.h | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -1,5 +1,5 @@ /* -** $Id: lzio.h,v 1.26.1.1 2013/04/12 18:48:47 roberto Exp $ +** $Id: lzio.h,v 1.31 2015/09/08 15:41:05 roberto Exp $ ** Buffered streams ** See Copyright Notice in lua.h */ @@ -32,20 +32,21 @@ typedef struct Mbuffer { #define luaZ_sizebuffer(buff) ((buff)->buffsize) #define luaZ_bufflen(buff) ((buff)->n) +#define luaZ_buffremove(buff,i) ((buff)->n -= (i)) #define luaZ_resetbuffer(buff) ((buff)->n = 0) #define luaZ_resizebuffer(L, buff, size) \ - (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \ + ((buff)->buffer = luaM_reallocvchar(L, (buff)->buffer, \ + (buff)->buffsize, size), \ (buff)->buffsize = size) #define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0) -LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n); LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data); -LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */ +LUAI_FUNC size_t luaZ_read (ZIO* z, void *b, size_t n); /* read next n bytes */ @@ -55,7 +56,7 @@ struct Zio { size_t n; /* bytes still unread */ const char *p; /* current position in buffer */ lua_Reader reader; /* reader function */ - void* data; /* additional data */ + void *data; /* additional data */ lua_State *L; /* Lua state (for reader) */ }; |