summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/lzio.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua/lzio.h')
-rw-r--r--apps/plugins/lua/lzio.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/plugins/lua/lzio.h b/apps/plugins/lua/lzio.h
index 441f7479cb..9aa9e4b537 100644
--- a/apps/plugins/lua/lzio.h
+++ b/apps/plugins/lua/lzio.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lzio.h,v 1.26.1.1 2013/04/12 18:48:47 roberto Exp $ 2** $Id$
3** Buffered streams 3** Buffered streams
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -17,8 +17,9 @@
17 17
18typedef struct Zio ZIO; 18typedef struct Zio ZIO;
19 19
20#define zgetc(z) (((z)->n--)>0 ? cast_uchar(*(z)->p++) : luaZ_fill(z)) 20#define char2int(c) cast(int, cast(unsigned char, (c)))
21 21
22#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z))
22 23
23typedef struct Mbuffer { 24typedef struct Mbuffer {
24 char *buffer; 25 char *buffer;
@@ -46,6 +47,7 @@ LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n);
46LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, 47LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
47 void *data); 48 void *data);
48LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */ 49LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */
50LUAI_FUNC int luaZ_lookahead (ZIO *z);
49 51
50 52
51 53
@@ -54,7 +56,7 @@ LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */
54struct Zio { 56struct Zio {
55 size_t n; /* bytes still unread */ 57 size_t n; /* bytes still unread */
56 const char *p; /* current position in buffer */ 58 const char *p; /* current position in buffer */
57 lua_Reader reader; /* reader function */ 59 lua_Reader reader;
58 void* data; /* additional data */ 60 void* data; /* additional data */
59 lua_State *L; /* Lua state (for reader) */ 61 lua_State *L; /* Lua state (for reader) */
60}; 62};