| 570 | } |
| 571 | |
| 572 | static int Lio_dump(lua_State *L) { |
| 573 | int res; |
| 574 | const char *fname = luaL_checkstring(L, 1); |
| 575 | FILE *fp = fopen(fname, "wb"); |
| 576 | if (fp == NULL) return luaL_fileresult(L, 0, fname); |
| 577 | res = io_write(L, fp, 2); |
| 578 | fclose(fp); |
| 579 | return res; |
| 580 | } |
| 581 | |
| 582 | LUALIB_API int luaopen_pb_io(lua_State *L) { |
| 583 | luaL_Reg libs[] = { |
nothing calls this directly
no test coverage detected