MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / luaL_getmetafield

Function luaL_getmetafield

lua/lauxlib.c:251–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249
250
251LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {
252 if (!lua_getmetatable(L, obj)) /* no metatable? */
253 return 0;
254 lua_pushstring(L, event);
255 lua_rawget(L, -2);
256 if (lua_isnil(L, -1)) {
257 lua_pop(L, 2); /* remove metatable and metafield */
258 return 0;
259 }
260 else {
261 lua_remove(L, -2); /* remove only metatable */
262 return 1;
263 }
264}
265
266
267LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {

Callers 3

luaB_getmetatableFunction · 0.85
luaB_setmetatableFunction · 0.85
luaL_callmetaFunction · 0.85

Calls 4

lua_getmetatableFunction · 0.85
lua_pushstringFunction · 0.85
lua_rawgetFunction · 0.85
lua_removeFunction · 0.85

Tested by

no test coverage detected