A hook has type lua_Hook
, defined as follows:
func
is the hook. mask
specifies on which events the hook will be called: It is formed by a disjunction of the constants , LUA_MASKRET
, LUA_MASKLINE
, and LUA_MASKCOUNT
. The count
argument is only meaningful when the mask includes LUA_MASKCOUNT
. For each event, the hook is called as explained below:
You can get the current hook, the current mask, and the current count with the following functions:
While Lua is running a hook, it disables other calls to hooks. Therefore, if a hook calls back Lua to execute a function or a chunk, that execution occurs without any calls to hooks.