MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / hookf

Function hookf

lua/ldblib.c:206–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204
205
206static void hookf (lua_State *L, lua_Debug *ar) {
207 static const char *const hooknames[] =
208 {"call", "return", "line", "count", "tail return"};
209 lua_pushlightuserdata(L, (void *)&KEY_HOOK);
210 lua_rawget(L, LUA_REGISTRYINDEX);
211 lua_pushlightuserdata(L, L);
212 lua_rawget(L, -2);
213 if (lua_isfunction(L, -1)) {
214 lua_pushstring(L, hooknames[(int)ar->event]);
215 if (ar->currentline >= 0)
216 lua_pushinteger(L, ar->currentline);
217 else lua_pushnil(L);
218 lua_assert(lua_getinfo(L, "lS", ar));
219 lua_call(L, 2, 0);
220 }
221}
222
223
224static 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