MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / luaL_getmetafield

Function luaL_getmetafield

libraries/AP_Scripting/lua/src/lauxlib.c:777–790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

775
776
777LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {
778 if (!lua_getmetatable(L, obj)) /* no metatable? */
779 return LUA_TNIL;
780 else {
781 int tt;
782 lua_pushstring(L, event);
783 tt = lua_rawget(L, -2);
784 if (tt == LUA_TNIL) /* is metafield nil? */
785 lua_pop(L, 2); /* remove metatable and metafield */
786 else
787 lua_remove(L, -2); /* remove only metatable */
788 return tt; /* return metafield type */
789 }
790}
791
792
793LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {

Callers 6

luaB_getmetatableFunction · 0.85
luaB_setmetatableFunction · 0.85
pairsmetaFunction · 0.85
typeerrorFunction · 0.85
luaL_callmetaFunction · 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