| 331 | |
| 332 | |
| 333 | static int db_gethook (lua_State *L) { |
| 334 | int arg; |
| 335 | lua_State *L1 = getthread(L, &arg); |
| 336 | char buff[5]; |
| 337 | int mask = lua_gethookmask(L1); |
| 338 | lua_Hook hook = lua_gethook(L1); |
| 339 | if (hook != NULL && hook != hookf) /* external hook? */ |
| 340 | lua_pushliteral(L, "external hook"); |
| 341 | else { |
| 342 | gethooktable(L); |
| 343 | checkstack(L, L1, 1); |
| 344 | lua_pushthread(L1); lua_xmove(L1, L, 1); |
| 345 | lua_rawget(L, -2); /* get hook */ |
| 346 | lua_remove(L, -2); /* remove hook table */ |
| 347 | } |
| 348 | lua_pushstring(L, unmakemask(mask, buff)); |
| 349 | lua_pushinteger(L, lua_gethookcount(L1)); |
| 350 | return 3; |
| 351 | } |
| 352 | |
| 353 | |
| 354 | static int db_debug (lua_State *L) { |
nothing calls this directly
no test coverage detected