MCPcopy Create free account
hub / github.com/DFHack/dfhack / f_setvbuf

Function f_setvbuf

depends/lua/src/liolib.c:677–685  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

675
676
677static int f_setvbuf (lua_State *L) {
678 static const int mode[] = {_IONBF, _IOFBF, _IOLBF};
679 static const char *const modenames[] = {"no", "full", "line", NULL};
680 FILE *f = tofile(L);
681 int op = luaL_checkoption(L, 2, NULL, modenames);
682 lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE);
683 int res = setvbuf(f, NULL, mode[op], (size_t)sz);
684 return luaL_fileresult(L, res == 0, NULL);
685}
686
687
688

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected