MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / luaZ_read

Function luaZ_read

deps/lua/src/lzio.c:58–71  ·  view source on GitHub ↗

--------------------------------------------------------------- read --- */

Source from the content-addressed store, hash-verified

56
57/* --------------------------------------------------------------- read --- */
58size_t luaZ_read (ZIO *z, void *b, size_t n) {
59 while (n) {
60 size_t m;
61 if (luaZ_lookahead(z) == EOZ)
62 return n; /* return number of missing bytes */
63 m = (n <= z->n) ? n : z->n; /* min. between n and z->n */
64 memcpy(b, z->p, m);
65 z->n -= m;
66 z->p += m;
67 b = (char *)b + m;
68 n -= m;
69 }
70 return 0;
71}
72
73/* ------------------------------------------------------------------------ */
74char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) {

Callers 1

LoadBlockFunction · 0.85

Calls 1

luaZ_lookaheadFunction · 0.85

Tested by

no test coverage detected