MCPcopy Create free account
hub / github.com/TASEmulators/fceux / f_setvbuf

Function f_setvbuf

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

Source from the content-addressed store, hash-verified

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

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