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

Function lua_rotate

3rd_party/lua_sol2/include/sol.hpp:3053–3066  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3051}
3052
3053COMPAT53_API void lua_rotate(lua_State *L, int idx, int n) {
3054 int n_elems = 0;
3055 idx = lua_absindex(L, idx);
3056 n_elems = lua_gettop(L) - idx + 1;
3057 if (n < 0)
3058 n += n_elems;
3059 if (n > 0 && n < n_elems) {
3060 luaL_checkstack(L, 2, "not enough stack slots available");
3061 n = n_elems - n;
3062 compat53_reverse(L, idx, idx + n - 1);
3063 compat53_reverse(L, idx + n, idx + n_elems - 1);
3064 compat53_reverse(L, idx, idx + n_elems - 1);
3065 }
3066}
3067
3068COMPAT53_API void lua_seti(lua_State *L, int index, lua_Integer i) {
3069 luaL_checkstack(L, 1, "not enough stack slots available");

Callers 1

script_throw_on_errorFunction · 0.85

Calls 3

lua_absindexFunction · 0.85
luaL_checkstackFunction · 0.85
compat53_reverseFunction · 0.85

Tested by

no test coverage detected