MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / lua_rotate

Function lua_rotate

extlibs/sol3/include/sol/sol.hpp:3121–3134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3119}
3120
3121COMPAT53_API void lua_rotate(lua_State *L, int idx, int n) {
3122 int n_elems = 0;
3123 idx = lua_absindex(L, idx);
3124 n_elems = lua_gettop(L) - idx + 1;
3125 if (n < 0)
3126 n += n_elems;
3127 if (n > 0 && n < n_elems) {
3128 luaL_checkstack(L, 2, "not enough stack slots available");
3129 n = n_elems - n;
3130 compat53_reverse(L, idx, idx + n - 1);
3131 compat53_reverse(L, idx + n, idx + n_elems - 1);
3132 compat53_reverse(L, idx, idx + n_elems - 1);
3133 }
3134}
3135
3136COMPAT53_API void lua_seti(lua_State *L, int index, lua_Integer i) {
3137 luaL_checkstack(L, 1, "not enough stack slots available");

Callers 1

script_throw_on_errorFunction · 0.70

Calls 4

lua_gettopFunction · 0.85
compat53_reverseFunction · 0.85
lua_absindexFunction · 0.70
luaL_checkstackFunction · 0.70

Tested by

no test coverage detected