| 279 | |
| 280 | |
| 281 | static int db_gethook (lua_State *L) { |
| 282 | int arg; |
| 283 | lua_State *L1 = getthread(L, &arg); |
| 284 | char buff[5]; |
| 285 | int mask = lua_gethookmask(L1); |
| 286 | lua_Hook hook = lua_gethook(L1); |
| 287 | if (hook != NULL && hook != hookf) /* external hook? */ |
| 288 | lua_pushliteral(L, "external hook"); |
| 289 | else { |
| 290 | gethooktable(L); |
| 291 | lua_pushlightuserdata(L, L1); |
| 292 | lua_rawget(L, -2); /* get hook */ |
| 293 | lua_remove(L, -2); /* remove hook table */ |
| 294 | } |
| 295 | lua_pushstring(L, unmakemask(mask, buff)); |
| 296 | lua_pushinteger(L, lua_gethookcount(L1)); |
| 297 | return 3; |
| 298 | } |
| 299 | |
| 300 | |
| 301 | static int db_debug (lua_State *L) { |
nothing calls this directly
no test coverage detected