** this function can be called asynchronous (e.g. during a signal) */
| 61 | ** this function can be called asynchronous (e.g. during a signal) |
| 62 | */ |
| 63 | LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { |
| 64 | if (func == NULL || mask == 0) { /* turn off hooks? */ |
| 65 | mask = 0; |
| 66 | func = NULL; |
| 67 | } |
| 68 | if (isLua(L->ci)) |
| 69 | L->oldpc = L->ci->u.l.savedpc; |
| 70 | L->hook = func; |
| 71 | L->basehookcount = count; |
| 72 | resethookcount(L); |
| 73 | L->hookmask = cast_byte(mask); |
| 74 | return 1; |
| 75 | } |
| 76 | |
| 77 | |
| 78 | LUA_API lua_Hook lua_gethook (lua_State *L) { |
no outgoing calls
no test coverage detected