MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaZ_read

Function luaZ_read

Source/Misc/lua/src/lua.c:10188–10201  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

10186
10187/* --------------------------------------------------------------- read --- */
10188size_t luaZ_read (ZIO *z, void *b, size_t n) {
10189while (n) {
10190size_t m;
10191if (luaZ_lookahead(z) == EOZ)
10192return n; /* return number of missing bytes */
10193m = (n <= z->n) ? n : z->n; /* min. between n and z->n */
10194memcpy(b, z->p, m);
10195z->n -= m;
10196z->p += m;
10197b = (char *)b + m;
10198n -= m;
10199}
10200return 0;
10201}
10202
10203/* ------------------------------------------------------------------------ */
10204char *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