ZIO passes Lua state to chunk reader
This commit is contained in:
5
lzio.h
5
lzio.h
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lzio.h,v 1.15 2003/03/20 16:00:56 roberto Exp roberto $
|
||||
** $Id: lzio.h,v 1.16 2003/08/25 19:51:54 roberto Exp roberto $
|
||||
** Buffered streams
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -20,7 +20,7 @@ typedef struct Zio ZIO;
|
||||
|
||||
#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z))
|
||||
|
||||
void luaZ_init (ZIO *z, lua_Chunkreader reader, void *data);
|
||||
void luaZ_init (lua_State *L, ZIO *z, lua_Chunkreader reader, void *data);
|
||||
size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */
|
||||
int luaZ_lookahead (ZIO *z);
|
||||
|
||||
@@ -53,6 +53,7 @@ struct Zio {
|
||||
const char *p; /* current position in buffer */
|
||||
lua_Chunkreader reader;
|
||||
void* data; /* additional data */
|
||||
lua_State *L; /* Lua state (for reader) */
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user