MCPcopy Create free account
hub / github.com/Tencent/xLua / lua_getmetatable

Function lua_getmetatable

WebGLPlugins/lapi.c:696–720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

694
695
696LUA_API int lua_getmetatable (lua_State *L, int objindex) {
697 const TValue *obj;
698 Table *mt;
699 int res = 0;
700 lua_lock(L);
701 obj = index2addr(L, objindex);
702 switch (ttnov(obj)) {
703 case LUA_TTABLE:
704 mt = hvalue(obj)->metatable;
705 break;
706 case LUA_TUSERDATA:
707 mt = uvalue(obj)->metatable;
708 break;
709 default:
710 mt = G(L)->mt[ttnov(obj)];
711 break;
712 }
713 if (mt != NULL) {
714 sethvalue(L, L->top, mt);
715 api_incr_top(L);
716 res = 1;
717 }
718 lua_unlock(L);
719 return res;
720}
721
722
723LUA_API int lua_getuservalue (lua_State *L, int idx) {

Callers 15

luaB_getmetatableFunction · 0.85
xlua_tocsobj_safeFunction · 0.85
xlua_tostructFunction · 0.85
xlua_gettypeidFunction · 0.85
is_cs_dataFunction · 0.85
css_cloneFunction · 0.85
luaL_testudataFunction · 0.85
luaL_getmetafieldFunction · 0.85
checktabFunction · 0.85
ll_seeallFunction · 0.85
lua_isint64Function · 0.85
lua_isint64_or_uint64Function · 0.85

Calls 1

index2addrFunction · 0.85

Tested by

no test coverage detected