| 11721 | |
| 11722 | |
| 11723 | static void hookf (lua_State *L, lua_Debug *ar) { |
| 11724 | static const char *const hooknames[] = |
| 11725 | {"call", "return", "line", "count", "tail return"}; |
| 11726 | lua_pushlightuserdata(L, (void *)&KEY_HOOK); |
| 11727 | lua_rawget(L, LUA_REGISTRYINDEX); |
| 11728 | lua_pushlightuserdata(L, L); |
| 11729 | lua_rawget(L, -2); |
| 11730 | if (lua_isfunction(L, -1)) { |
| 11731 | lua_pushstring(L, hooknames[(int)ar->event]); |
| 11732 | if (ar->currentline >= 0) |
| 11733 | lua_pushinteger(L, ar->currentline); |
| 11734 | else lua_pushnil(L); |
| 11735 | lua_assert(lua_getinfo(L, "lS", ar)); |
| 11736 | lua_call(L, 2, 0); |
| 11737 | } |
| 11738 | } |
| 11739 | |
| 11740 | |
| 11741 | static int makemask (const char *smask, int count) { |
nothing calls this directly
no test coverage detected