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

Function f_setvbuf

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

Source from the content-addressed store, hash-verified

720
721
722static int f_setvbuf (lua_State *L) {
723 static const int mode[] = {_IONBF, _IOFBF, _IOLBF};
724 static const char *const modenames[] = {"no", "full", "line", NULL};
725 FILE *f = tofile(L);
726 int op = luaL_checkoption(L, 2, NULL, modenames);
727 lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE);
728 int res;
729 errno = 0;
730 res = setvbuf(f, NULL, mode[op], (size_t)sz);
731 return luaL_fileresult(L, res == 0, NULL);
732}
733
734
735static int aux_flush (lua_State *L, FILE *f) {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected