| 457 | |
| 458 | |
| 459 | static 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 |
nothing calls this directly
no test coverage detected