MCPcopy Create free account
hub / github.com/Tencent/UnLua / luaL_testudata

Function luaL_testudata

Plugins/UnLuaExtensions/LuaProtobuf/Source/src/pb.cpp:71–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71static void *luaL_testudata(lua_State *L, int idx, const char *type) {
72 void *p = lua_touserdata(L, idx);
73 if (p != NULL && lua_getmetatable(L, idx)) {
74 lua_getfield(L, LUA_REGISTRYINDEX, type);
75 if (!lua_rawequal(L, -2, -1))
76 p = NULL;
77 lua_pop(L, 2);
78 return p;
79 }
80 return NULL;
81}
82
83#endif
84

Callers 2

Lpb_deleteFunction · 0.70
auxiliar_getclassudataFunction · 0.50

Calls 4

lua_touserdataFunction · 0.85
lua_getmetatableFunction · 0.85
lua_getfieldFunction · 0.85
lua_rawequalFunction · 0.85

Tested by

no test coverage detected