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

Function read_all

third-party/lua-5.5.0/src/liolib.c:542–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

540
541
542static void read_all (lua_State *L, FILE *f) {
543 size_t nr;
544 luaL_Buffer b;
545 luaL_buffinit(L, &b);
546 do { /* read file in chunks of LUAL_BUFFERSIZE bytes */
547 char *p = luaL_prepbuffer(&b);
548 nr = fread(p, sizeof(char), LUAL_BUFFERSIZE, f);
549 luaL_addsize(&b, nr);
550 } while (nr == LUAL_BUFFERSIZE);
551 luaL_pushresult(&b); /* close buffer */
552}
553
554
555static 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