| 461 | |
| 462 | |
| 463 | static int f_setvbuf (lua_State *L) { |
| 464 | static const int mode[] = {_IONBF, _IOFBF, _IOLBF}; |
| 465 | static const char *const modenames[] = {"no", "full", "line", NULL}; |
| 466 | FILE *f = tofile(L); |
| 467 | int op = luaL_checkoption(L, 2, NULL, modenames); |
| 468 | lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); |
| 469 | int res = setvbuf(f, NULL, mode[op], sz); |
| 470 | return pushresult(L, res == 0, NULL); |
| 471 | } |
| 472 | |
| 473 | |
| 474 |
nothing calls this directly
no test coverage detected