| 720 | |
| 721 | |
| 722 | static int f_setvbuf (lua_State *L) { |
| 723 | static const int mode[] = {_IONBF, _IOFBF, _IOLBF}; |
| 724 | static const char *const modenames[] = {"no", "full", "line", NULL}; |
| 725 | FILE *f = tofile(L); |
| 726 | int op = luaL_checkoption(L, 2, NULL, modenames); |
| 727 | lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); |
| 728 | int res; |
| 729 | errno = 0; |
| 730 | res = setvbuf(f, NULL, mode[op], (size_t)sz); |
| 731 | return luaL_fileresult(L, res == 0, NULL); |
| 732 | } |
| 733 | |
| 734 | |
| 735 | static int aux_flush (lua_State *L, FILE *f) { |
nothing calls this directly
no test coverage detected