** this function can be called asynchronous (e.g. during a signal) */
| 4562 | ** this function can be called asynchronous (e.g. during a signal) |
| 4563 | */ |
| 4564 | LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { |
| 4565 | if (func == NULL || mask == 0) { /* turn off hooks? */ |
| 4566 | mask = 0; |
| 4567 | func = NULL; |
| 4568 | } |
| 4569 | L->hook = func; |
| 4570 | L->basehookcount = count; |
| 4571 | resethookcount(L); |
| 4572 | L->hookmask = cast_byte(mask); |
| 4573 | return 1; |
| 4574 | } |
| 4575 | |
| 4576 | |
| 4577 | LUA_API lua_Hook lua_gethook (lua_State *L) { |