LUA updated to 5.3.0
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lzio.h,v 1.21.1.1 2007/12/27 13:02:25 roberto Exp $
|
||||
** $Id: lzio.h,v 1.30 2014/12/19 17:26:14 roberto Exp $
|
||||
** Buffered streams
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -17,9 +17,8 @@
|
||||
|
||||
typedef struct Zio ZIO;
|
||||
|
||||
#define char2int(c) cast(int, cast(unsigned char, (c)))
|
||||
#define zgetc(z) (((z)->n--)>0 ? cast_uchar(*(z)->p++) : luaZ_fill(z))
|
||||
|
||||
#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z))
|
||||
|
||||
typedef struct Mbuffer {
|
||||
char *buffer;
|
||||
@@ -33,11 +32,13 @@ 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)
|
||||
@@ -46,8 +47,7 @@ typedef struct Mbuffer {
|
||||
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 int luaZ_lookahead (ZIO *z);
|
||||
LUAI_FUNC size_t luaZ_read (ZIO* z, void *b, size_t n); /* read next n bytes */
|
||||
|
||||
|
||||
|
||||
@@ -56,8 +56,8 @@ LUAI_FUNC int luaZ_lookahead (ZIO *z);
|
||||
struct Zio {
|
||||
size_t n; /* bytes still unread */
|
||||
const char *p; /* current position in buffer */
|
||||
lua_Reader reader;
|
||||
void* data; /* additional data */
|
||||
lua_Reader reader; /* reader function */
|
||||
void *data; /* additional data */
|
||||
lua_State *L; /* Lua state (for reader) */
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user