MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / read_all

Function read_all

extlibs/lua/src/liolib.c:526–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524
525
526static void read_all (lua_State *L, FILE *f) {
527 size_t nr;
528 luaL_Buffer b;
529 luaL_buffinit(L, &b);
530 do { /* read file in chunks of LUAL_BUFFERSIZE bytes */
531 char *p = luaL_prepbuffer(&b);
532 nr = fread(p, sizeof(char), LUAL_BUFFERSIZE, f);
533 luaL_addsize(&b, nr);
534 } while (nr == LUAL_BUFFERSIZE);
535 luaL_pushresult(&b); /* close buffer */
536}
537
538
539static int read_chars (lua_State *L, FILE *f, size_t n) {

Callers 1

g_readFunction · 0.85

Calls 2

luaL_buffinitFunction · 0.70
luaL_pushresultFunction · 0.70

Tested by

no test coverage detected