MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / hookf

Function hookf

Source/Misc/lua/src/lua.c:11723–11738  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

lua_pushlightuserdataFunction · 0.85
lua_rawgetFunction · 0.85
lua_pushstringFunction · 0.85
lua_pushintegerFunction · 0.85
lua_pushnilFunction · 0.85
lua_getinfoFunction · 0.85
lua_callFunction · 0.85

Tested by

no test coverage detected