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

Function luaT_gettmbyobj

depends/lua/src/ltm.c:70–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69
70const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) {
71 Table *mt;
72 switch (ttnov(o)) {
73 case LUA_TTABLE:
74 mt = hvalue(o)->metatable;
75 break;
76 case LUA_TUSERDATA:
77 mt = uvalue(o)->metatable;
78 break;
79 default:
80 mt = G(L)->mt[ttnov(o)];
81 }
82 return (mt ? luaH_getshortstr(mt, G(L)->tmname[event]) : luaO_nilobject);
83}
84
85
86/*

Callers 6

luaV_finishgetFunction · 0.85
luaV_finishsetFunction · 0.85
luaV_objlenFunction · 0.85
luaT_callbinTMFunction · 0.85
tryfuncTMFunction · 0.85
GCTMFunction · 0.85

Calls 1

luaH_getshortstrFunction · 0.85

Tested by

no test coverage detected