MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / luaL_getmetafield

Function luaL_getmetafield

extlibs/lua/src/lauxlib.c:821–834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

819
820
821LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {
822 if (!lua_getmetatable(L, obj)) /* no metatable? */
823 return LUA_TNIL;
824 else {
825 int tt;
826 lua_pushstring(L, event);
827 tt = lua_rawget(L, -2);
828 if (tt == LUA_TNIL) /* is metafield nil? */
829 lua_pop(L, 2); /* remove metatable and metafield */
830 else
831 lua_remove(L, -2); /* remove only metatable */
832 return tt; /* return metafield type */
833 }
834}
835
836
837LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {

Callers 8

luaB_getmetatableFunction · 0.85
luaB_setmetatableFunction · 0.85
luaB_pairsFunction · 0.85
trymtFunction · 0.85
luaL_typeerrorFunction · 0.85
luaL_callmetaFunction · 0.85
luaL_tolstringFunction · 0.85
luaL_tolstringFunction · 0.85

Calls 3

lua_getmetatableFunction · 0.85
lua_pushstringFunction · 0.85
lua_rawgetFunction · 0.85

Tested by

no test coverage detected