| 699 | |
| 700 | |
| 701 | static int f_setvbuf (lua_State *L) { |
| 702 | static const int mode[] = {_IONBF, _IOFBF, _IOLBF}; |
| 703 | static const char *const modenames[] = {"no", "full", "line", NULL}; |
| 704 | FILE *f = tofile(L); |
| 705 | int op = luaL_checkoption(L, 2, NULL, modenames); |
| 706 | lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); |
| 707 | int res = setvbuf(f, NULL, mode[op], (size_t)sz); |
| 708 | return luaL_fileresult(L, res == 0, NULL); |
| 709 | } |
| 710 | |
| 711 | |
| 712 |
nothing calls this directly
no test coverage detected