MCPcopy Create free account
hub / github.com/defold/defold / f_setvbuf

Function f_setvbuf

engine/lua/src/lua/liolib.c:459–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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