MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / luaL_getsubtable

Function luaL_getsubtable

Libs/sol/sol.hpp:3137–3150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3135}
3136
3137COMPAT53_API int luaL_getsubtable(lua_State* L, int i, const char* name) {
3138 int abs_i = lua_absindex(L, i);
3139 luaL_checkstack(L, 3, "not enough stack slots");
3140 lua_pushstring(L, name);
3141 lua_gettable(L, abs_i);
3142 if (lua_istable(L, -1))
3143 return 1;
3144 lua_pop(L, 1);
3145 lua_newtable(L);
3146 lua_pushstring(L, name);
3147 lua_pushvalue(L, -2);
3148 lua_settable(L, abs_i);
3149 return 0;
3150}
3151
3152COMPAT53_API lua_Integer luaL_len(lua_State* L, int i) {
3153 lua_Integer res = 0;

Callers 1

luaL_requirefFunction · 0.85

Calls 2

lua_absindexFunction · 0.85
luaL_checkstackFunction · 0.85

Tested by

no test coverage detected