MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / f_setvbuf

Function f_setvbuf

lua/liolib.c:463–471  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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