core tests whether file is binary
This commit is contained in:
13
lzio.c
13
lzio.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lzio.c,v 1.16 2002/04/29 12:37:41 roberto Exp roberto $
|
||||
** $Id: lzio.c,v 1.17 2002/06/03 17:46:34 roberto Exp roberto $
|
||||
** a generic input stream interface
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -24,6 +24,17 @@ int luaZ_fill (ZIO *z) {
|
||||
}
|
||||
|
||||
|
||||
int luaZ_lookahead (ZIO *z) {
|
||||
if (z->n == 0) {
|
||||
int c = luaZ_fill(z);
|
||||
if (c == EOZ) return c;
|
||||
z->n++;
|
||||
z->p--;
|
||||
}
|
||||
return *z->p;
|
||||
}
|
||||
|
||||
|
||||
void luaZ_init (ZIO *z, lua_Getblock getblock, void *ud, const char *name) {
|
||||
z->getblock = getblock;
|
||||
z->ud = ud;
|
||||
|
||||
Reference in New Issue
Block a user