MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / read_all

Function read_all

third-party/lua-5.3.5/src/liolib.c:503–513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

501
502
503static void read_all (lua_State *L, FILE *f) {
504 size_t nr;
505 luaL_Buffer b;
506 luaL_buffinit(L, &b);
507 do { /* read file in chunks of LUAL_BUFFERSIZE bytes */
508 char *p = luaL_prepbuffer(&b);
509 nr = fread(p, sizeof(char), LUAL_BUFFERSIZE, f);
510 luaL_addsize(&b, nr);
511 } while (nr == LUAL_BUFFERSIZE);
512 luaL_pushresult(&b); /* close buffer */
513}
514
515
516static int read_chars (lua_State *L, FILE *f, size_t n) {

Callers 1

g_readFunction · 0.70

Calls 3

luaL_prepbufferFunction · 0.85
luaL_buffinitFunction · 0.70
luaL_pushresultFunction · 0.70

Tested by

no test coverage detected