MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / hookf

Function hookf

deps/lua/src/ldblib.c:207–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205
206
207static 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
225static 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