MCPcopy Create free account
hub / github.com/axmolengine/axmol / lua_getmetatable

Function lua_getmetatable

3rdparty/lua/plainlua/lapi.c:775–799  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

773
774
775LUA_API int lua_getmetatable (lua_State *L, int objindex) {
776 const TValue *obj;
777 Table *mt;
778 int res = 0;
779 lua_lock(L);
780 obj = index2value(L, objindex);
781 switch (ttype(obj)) {
782 case LUA_TTABLE:
783 mt = hvalue(obj)->metatable;
784 break;
785 case LUA_TUSERDATA:
786 mt = uvalue(obj)->metatable;
787 break;
788 default:
789 mt = G(L)->mt[ttype(obj)];
790 break;
791 }
792 if (mt != NULL) {
793 sethvalue2s(L, L->top.p, mt);
794 api_incr_top(L);
795 res = 1;
796 }
797 lua_unlock(L);
798 return res;
799}
800
801
802LUA_API int lua_getiuservalue (lua_State *L, int idx, int n) {

Callers 15

luaL_testudataFunction · 0.85
associated_type_nameFunction · 0.85
checkMethod · 0.85
checkMethod · 0.85
get_no_lua_nil_fromMethod · 0.85
getMethod · 0.85
index_failFunction · 0.85
clearMethod · 0.85
readonly_pairsFunction · 0.85
pairs_iteratorMethod · 0.85
getMethod · 0.85

Calls 1

index2valueFunction · 0.85

Tested by

no test coverage detected