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

Function read_chars

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

Source from the content-addressed store, hash-verified

553
554
555static int read_chars (lua_State *L, FILE *f, size_t n) {
556 size_t nr; /* number of chars actually read */
557 char *p;
558 luaL_Buffer b;
559 luaL_buffinit(L, &b);
560 p = luaL_prepbuffsize(&b, n); /* prepare buffer to read whole block */
561 nr = fread(p, sizeof(char), n, f); /* try to read 'n' chars */
562 luaL_addsize(&b, nr);
563 luaL_pushresult(&b); /* close buffer */
564 return (nr > 0); /* true iff read something */
565}
566
567
568static int g_read (lua_State *L, FILE *f, int first) {

Callers 1

g_readFunction · 0.70

Calls 3

luaL_buffinitFunction · 0.70
luaL_prepbuffsizeFunction · 0.70
luaL_pushresultFunction · 0.70

Tested by

no test coverage detected