MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / f_setvbuf

Function f_setvbuf

deps/lua/src/liolib.c:458–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456
457
458static int f_setvbuf (lua_State *L) {
459 static const int mode[] = {_IONBF, _IOFBF, _IOLBF};
460 static const char *const modenames[] = {"no", "full", "line", NULL};
461 FILE *f = tofile(L);
462 int op = luaL_checkoption(L, 2, NULL, modenames);
463 lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE);
464 int res = setvbuf(f, NULL, mode[op], sz);
465 return pushresult(L, res == 0, NULL);
466}
467
468
469

Callers

nothing calls this directly

Calls 4

tofileFunction · 0.85
luaL_checkoptionFunction · 0.85
luaL_optintegerFunction · 0.85
pushresultFunction · 0.85

Tested by

no test coverage detected