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

Function read_all

third-party/lua-5.4.6/src/liolib.c:543–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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