MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaL_getmetafield

Function luaL_getmetafield

freebsd/contrib/openzfs/module/lua/lauxlib.c:555–568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553
554
555LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {
556 if (!lua_getmetatable(L, obj)) /* no metatable? */
557 return 0;
558 lua_pushstring(L, event);
559 lua_rawget(L, -2);
560 if (lua_isnil(L, -1)) {
561 lua_pop(L, 2); /* remove metatable and metafield */
562 return 0;
563 }
564 else {
565 lua_remove(L, -2); /* remove only metatable */
566 return 1;
567 }
568}
569
570
571LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {

Callers 4

luaB_getmetatableFunction · 0.70
luaB_setmetatableFunction · 0.70
pairsmetaFunction · 0.70
luaL_callmetaFunction · 0.70

Calls 4

lua_getmetatableFunction · 0.70
lua_pushstringFunction · 0.70
lua_rawgetFunction · 0.70
lua_removeFunction · 0.70

Tested by

no test coverage detected