| 225 | |
| 226 | |
| 227 | static int str_dump (lua_State *L) { |
| 228 | struct str_Writer state; |
| 229 | int strip = lua_toboolean(L, 2); |
| 230 | luaL_argcheck(L, lua_type(L, 1) == LUA_TFUNCTION && !lua_iscfunction(L, 1), |
| 231 | 1, "Lua function expected"); |
| 232 | /* ensure function is on the top of the stack and vacate slot 1 */ |
| 233 | lua_pushvalue(L, 1); |
| 234 | state.init = 0; |
| 235 | lua_dump(L, writer, &state, strip); |
| 236 | lua_settop(L, 1); /* leave final result on top */ |
| 237 | return 1; |
| 238 | } |
| 239 | |
| 240 | |
| 241 |
nothing calls this directly
no test coverage detected