MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / f_setvbuf

Function f_setvbuf

other_src/lua/src/liolib.cpp: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

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

Tested by

no test coverage detected