MCPcopy Create free account
hub / github.com/DFHack/dfhack / getfuncname

Function getfuncname

depends/lua/src/ldebug.c:249–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247
248
249static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) {
250 if (ci == NULL) /* no 'ci'? */
251 return NULL; /* no info */
252 else if (ci->callstatus & CIST_FIN) { /* is this a finalizer? */
253 *name = "__gc";
254 return "metamethod"; /* report it as such */
255 }
256 /* calling function is a known Lua function? */
257 else if (!(ci->callstatus & CIST_TAIL) && isLua(ci->previous))
258 return funcnamefromcode(L, ci->previous, name);
259 else return NULL; /* no way to find a name */
260}
261
262
263static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar,

Callers 1

auxgetinfoFunction · 0.85

Calls 1

funcnamefromcodeFunction · 0.85

Tested by

no test coverage detected