| 205 | |
| 206 | |
| 207 | static void hookf (lua_State *L, lua_Debug *ar) { |
| 208 | static const char *const hooknames[] = |
| 209 | {"call", "return", "line", "count", "tail return"}; |
| 210 | lua_pushlightuserdata(L, (void *)&KEY_HOOK); |
| 211 | lua_rawget(L, LUA_REGISTRYINDEX); |
| 212 | lua_pushlightuserdata(L, L); |
| 213 | lua_rawget(L, -2); |
| 214 | if (lua_isfunction(L, -1)) { |
| 215 | lua_pushstring(L, hooknames[(int)ar->event]); |
| 216 | if (ar->currentline >= 0) |
| 217 | lua_pushinteger(L, ar->currentline); |
| 218 | else lua_pushnil(L); |
| 219 | lua_assert(lua_getinfo(L, "lS", ar)); |
| 220 | lua_call(L, 2, 0); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | |
| 225 | static int makemask (const char *smask, int count) { |
nothing calls this directly
no test coverage detected