MCPcopy Create free account
hub / github.com/Tencent/xLua / xlua_tostruct

Function xlua_tostruct

WebGLPlugins/xlua.c:854–867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

852}
853
854LUA_API void *xlua_tostruct(lua_State *L, int idx, int meta_ref) {
855 CSharpStruct *css = (CSharpStruct *)lua_touserdata(L, idx);
856 if (NULL != css) {
857 if (lua_getmetatable (L, idx)) {
858 lua_rawgeti(L, -1, 1);
859 if (lua_type(L, -1) == LUA_TNUMBER && (int)lua_tointeger(L, -1) == meta_ref) {
860 lua_pop(L, 2);
861 return css->data;
862 }
863 lua_pop(L, 2);
864 }
865 }
866 return NULL;
867}
868
869LUA_API int xlua_gettypeid(lua_State *L, int idx) {
870 int type_id = -1;

Callers

nothing calls this directly

Calls 4

lua_touserdataFunction · 0.85
lua_getmetatableFunction · 0.85
lua_rawgetiFunction · 0.85
lua_typeFunction · 0.85

Tested by

no test coverage detected