mirror of https://github.com/rusefi/lua.git
reader runs outside core Lua
This commit is contained in:
parent
b114142799
commit
885961be1d
9
lzio.c
9
lzio.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lzio.c,v 1.25 2003/08/25 19:51:54 roberto Exp roberto $
|
** $Id: lzio.c,v 1.26 2003/08/25 20:00:50 roberto Exp roberto $
|
||||||
** a generic input stream interface
|
** a generic input stream interface
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -13,12 +13,17 @@
|
||||||
|
|
||||||
#include "llimits.h"
|
#include "llimits.h"
|
||||||
#include "lmem.h"
|
#include "lmem.h"
|
||||||
|
#include "lstate.h"
|
||||||
#include "lzio.h"
|
#include "lzio.h"
|
||||||
|
|
||||||
|
|
||||||
int luaZ_fill (ZIO *z) {
|
int luaZ_fill (ZIO *z) {
|
||||||
size_t size;
|
size_t size;
|
||||||
const char *buff = z->reader(z->L, z->data, &size);
|
lua_State *L = z->L;
|
||||||
|
const char *buff;
|
||||||
|
lua_unlock(L);
|
||||||
|
buff = z->reader(L, z->data, &size);
|
||||||
|
lua_lock(L);
|
||||||
if (buff == NULL || size == 0) return EOZ;
|
if (buff == NULL || size == 0) return EOZ;
|
||||||
z->n = size - 1;
|
z->n = size - 1;
|
||||||
z->p = buff;
|
z->p = buff;
|
||||||
|
|
Loading…
Reference in New Issue