| 453 | |
| 454 | |
| 455 | static 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 |
nothing calls this directly
no test coverage detected