| 675 | |
| 676 | |
| 677 | static int f_setvbuf (lua_State *L) { |
| 678 | static const int mode[] = {_IONBF, _IOFBF, _IOLBF}; |
| 679 | static const char *const modenames[] = {"no", "full", "line", NULL}; |
| 680 | FILE *f = tofile(L); |
| 681 | int op = luaL_checkoption(L, 2, NULL, modenames); |
| 682 | lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); |
| 683 | int res = setvbuf(f, NULL, mode[op], (size_t)sz); |
| 684 | return luaL_fileresult(L, res == 0, NULL); |
| 685 | } |
| 686 | |
| 687 | |
| 688 |
nothing calls this directly
no test coverage detected