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