aboutsummaryrefslogtreecommitdiff
path: root/lzio.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-08-25 17:00:50 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-08-25 17:00:50 -0300
commit4b2e71ddb674c3bb22f549743721155ddaeb9b5d (patch)
tree0dfbbf6eb89f732af749085df890448c7b5c33d5 /lzio.h
parent9fcc48517659c72de43bece515fdd5cea88c07f8 (diff)
downloadlua-4b2e71ddb674c3bb22f549743721155ddaeb9b5d.tar.gz
lua-4b2e71ddb674c3bb22f549743721155ddaeb9b5d.tar.bz2
lua-4b2e71ddb674c3bb22f549743721155ddaeb9b5d.zip
ZIO passes Lua state to chunk reader
Diffstat (limited to 'lzio.h')
-rw-r--r--lzio.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lzio.h b/lzio.h
index d2a99071..bcf11e45 100644
--- a/lzio.h
+++ b/lzio.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lzio.h,v 1.15 2003/03/20 16:00:56 roberto Exp roberto $ 2** $Id: lzio.h,v 1.16 2003/08/25 19:51:54 roberto Exp roberto $
3** Buffered streams 3** Buffered streams
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -20,7 +20,7 @@ typedef struct Zio ZIO;
20 20
21#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z)) 21#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z))
22 22
23void luaZ_init (ZIO *z, lua_Chunkreader reader, void *data); 23void luaZ_init (lua_State *L, ZIO *z, lua_Chunkreader reader, void *data);
24size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */ 24size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */
25int luaZ_lookahead (ZIO *z); 25int luaZ_lookahead (ZIO *z);
26 26
@@ -53,6 +53,7 @@ struct Zio {
53 const char *p; /* current position in buffer */ 53 const char *p; /* current position in buffer */
54 lua_Chunkreader reader; 54 lua_Chunkreader reader;
55 void* data; /* additional data */ 55 void* data; /* additional data */
56 lua_State *L; /* Lua state (for reader) */
56}; 57};
57 58
58 59