MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / luaL_getmetafield

Function luaL_getmetafield

other_src/lua/src/lauxlib.cpp:228–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226
227
228LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {
229 if (!lua_getmetatable(L, obj)) /* no metatable? */
230 return 0;
231 lua_pushstring(L, event);
232 lua_rawget(L, -2);
233 if (lua_isnil(L, -1)) {
234 lua_pop(L, 2); /* remove metatable and metafield */
235 return 0;
236 }
237 else {
238 lua_remove(L, -2); /* remove only metatable */
239 return 1;
240 }
241}
242
243
244LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {

Callers 3

luaL_callmetaFunction · 0.70
luaB_getmetatableFunction · 0.70
luaB_setmetatableFunction · 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