diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-10-23 18:44:34 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-12-14 11:00:25 +0100 |
commit | 01650b71c92a67807e346bfff655c59df58f2bfd (patch) | |
tree | 1e42fb8a6aef0cd70c71b048ae79d2d00a4b27c9 /3rdparty/lua/src/lzio.c | |
parent | 8df3e437f941912067231250ff5695b8a3a7fd92 (diff) |
Remove external 3rdparty library
Downloaded at build time.
Change-Id: If15e9bcb4cc7d09cec1837a0ad62e4a3c6beb4e1
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to '3rdparty/lua/src/lzio.c')
-rw-r--r-- | 3rdparty/lua/src/lzio.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/3rdparty/lua/src/lzio.c b/3rdparty/lua/src/lzio.c deleted file mode 100644 index c9e1f49..0000000 --- a/3rdparty/lua/src/lzio.c +++ /dev/null @@ -1,68 +0,0 @@ -/* -** $Id: lzio.c,v 1.37 2015/09/08 15:41:05 roberto Exp $ -** Buffered streams -** See Copyright Notice in lua.h -*/ - -#define lzio_c -#define LUA_CORE - -#include "lprefix.h" - - -#include <string.h> - -#include "lua.h" - -#include "llimits.h" -#include "lmem.h" -#include "lstate.h" -#include "lzio.h" - - -int luaZ_fill (ZIO *z) { - size_t 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; - z->n = size - 1; /* discount char being returned */ - z->p = buff; - return cast_uchar(*(z->p++)); -} - - -void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) { - z->L = L; - z->reader = reader; - z->data = data; - z->n = 0; - z->p = NULL; -} - - -/* --------------------------------------------------------------- read --- */ -size_t luaZ_read (ZIO *z, void *b, size_t n) { - while (n) { - size_t m; - if (z->n == 0) { /* no bytes in buffer? */ - if (luaZ_fill(z) == EOZ) /* try to read more */ - return n; /* no more input; return number of missing bytes */ - else { - z->n++; /* luaZ_fill consumed first byte; put it back */ - z->p--; - } - } - m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ - memcpy(b, z->p, m); - z->n -= m; - z->p += m; - b = (char *)b + m; - n -= m; - } - return 0; -} - |