summaryrefslogtreecommitdiffstats
path: root/lua/lzio.h
diff options
context:
space:
mode:
authorEmil Renner Berthing <esmil@mailme.dk>2016-01-07 22:39:28 +0100
committerEmil Renner Berthing <esmil@mailme.dk>2016-01-08 00:20:13 +0100
commit4c0ad860e7710b8cecaa13b96dfc6bdb8d6a14ea (patch)
tree089aff1638d71783695571cdae7cbf026277b5eb /lua/lzio.h
parente005effffa9b69bb1a93a8031308700ae8e4a857 (diff)
downloadlem-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.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/lua/lzio.h b/lua/lzio.h
index 441f747..e7b6f34 100644
--- a/lua/lzio.h
+++ b/lua/lzio.h
@@ -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) */
};