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

Function f_setvbuf

extlibs/lua/src/liolib.c:701–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

699
700
701static int f_setvbuf (lua_State *L) {
702 static const int mode[] = {_IONBF, _IOFBF, _IOLBF};
703 static const char *const modenames[] = {"no", "full", "line", NULL};
704 FILE *f = tofile(L);
705 int op = luaL_checkoption(L, 2, NULL, modenames);
706 lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE);
707 int res = setvbuf(f, NULL, mode[op], (size_t)sz);
708 return luaL_fileresult(L, res == 0, NULL);
709}
710
711
712

Callers

nothing calls this directly

Calls 4

tofileFunction · 0.85
luaL_checkoptionFunction · 0.85
luaL_optintegerFunction · 0.85
luaL_fileresultFunction · 0.70

Tested by

no test coverage detected