Go to the documentation of this file.
30 #define TAB_RW (TAB_R | TAB_W)
33 #define aux_getn(L,n,w) (checktab(L, n, (w) | TAB_L), luaL_len(L, n))
74 "position out of bounds");
75 for (i = e; i > pos; i--) {
82 return luaL_error(L,
"wrong number of arguments to 'insert'");
96 "position out of bounds");
98 for ( ; pos <
size; pos++) {
124 "too many elements to move");
127 "destination wrap around");
129 for (i = 0; i < n; i++) {
135 for (i = n - 1; i >= 0; i--) {
149 luaL_error(L,
"invalid value (%s) at index %I in table for 'concat'",
163 for (; i < last; i++) {
185 for (i = n; i >= 1; i--)
199 if (l_unlikely(n >= (
unsigned int)INT_MAX ||
201 return luaL_error(L,
"too many results to unpack");
232 #if !defined(l_randomizePivot)
237 #define sof(e) (sizeof(e) / sizeof(unsigned int))
247 time_t t =
time(NULL);
248 unsigned int buff[
sof(c) +
sof(t)];
249 unsigned int i, rnd = 0;
250 memcpy(buff, &c,
sof(c) *
sizeof(
unsigned int));
251 memcpy(buff +
sof(c), &t,
sof(t) *
sizeof(
unsigned int));
252 for (i = 0; i <
sof(buff); i++)
261 #define RANLIMIT 100u
304 if (l_unlikely(i == up - 1))
305 luaL_error(L,
"invalid order function for sorting");
311 if (l_unlikely(j < i))
312 luaL_error(L,
"invalid order function for sorting");
334 IdxT r4 = (up - lo) / 4;
335 IdxT p = rnd % (r4 * 2) + (lo + r4);
382 if (p - lo < up - p) {
392 if ((up - lo) / 128 > n)
static const luaL_Reg tab_funcs[]
static int sort_comp(lua_State *L, int a, int b)
LUA_UNSIGNED lua_Unsigned
LUA_API int lua_geti(lua_State *L, int idx, lua_Integer n)
static int tmove(lua_State *L)
static unsigned int l_randomizePivot(void)
LUA_API int lua_checkstack(lua_State *L, int n)
static int tpack(lua_State *L)
LUALIB_API void luaL_buffinit(lua_State *L, luaL_Buffer *B)
static int checkfield(lua_State *L, const char *key, int n)
LUA_API void lua_pushinteger(lua_State *L, lua_Integer n)
#define luaL_typename(L, i)
static void set2(lua_State *L, IdxT i, IdxT j)
auto arg(const Char *name, const T &arg) -> detail::named_arg< Char, T >
#define lua_isnoneornil(L, n)
LUALIB_API void luaL_addlstring(luaL_Buffer *B, const char *s, size_t l)
LUA_API int lua_isstring(lua_State *L, int idx)
LUA_API int lua_type(lua_State *L, int idx)
const LUA_API char * lua_pushstring(lua_State *L, const char *s)
LUAMOD_API int luaopen_table(lua_State *L)
LUALIB_API void luaL_pushresult(luaL_Buffer *B)
const LUALIB_API char * luaL_optlstring(lua_State *L, int arg, const char *def, size_t *len)
static IdxT choosePivot(IdxT lo, IdxT up, unsigned int rnd)
static int tremove(lua_State *L)
static void checktab(lua_State *L, int arg, int what)
span_constexpr std::size_t size(span< T, Extent > const &spn)
static int tconcat(lua_State *L)
#define lua_insert(L, idx)
LUA_API int lua_rawget(lua_State *L, int idx)
LUA_API void lua_setfield(lua_State *L, int idx, const char *k)
#define luaL_opt(L, f, n, d)
#define luaL_argcheck(L, cond, arg, extramsg)
static int tinsert(lua_State *L)
LUA_API int lua_gettop(lua_State *L)
LUA_API void lua_settop(lua_State *L, int idx)
static int sort(lua_State *L)
LUA_API void lua_pushvalue(lua_State *L, int idx)
LUALIB_API lua_Integer luaL_len(lua_State *L, int idx)
LUALIB_API void luaL_checktype(lua_State *L, int arg, int t)
LUA_API int lua_getmetatable(lua_State *L, int objindex)
#define lua_call(L, n, r)
static int tunpack(lua_State *L)
#define aux_getn(L, n, w)
LUALIB_API lua_Integer luaL_optinteger(lua_State *L, int arg, lua_Integer def)
#define luaL_newlib(L, l)
LUA_API void lua_seti(lua_State *L, int idx, lua_Integer n)
LUALIB_API int luaL_error(lua_State *L, const char *fmt,...)
LUALIB_API lua_Integer luaL_checkinteger(lua_State *L, int arg)
LUA_API void lua_pushnil(lua_State *L)
LUA_API int lua_toboolean(lua_State *L, int idx)
static IdxT partition(lua_State *L, IdxT lo, IdxT up)
static void auxsort(lua_State *L, IdxT lo, IdxT up, unsigned int rnd)
LUALIB_API void luaL_addvalue(luaL_Buffer *B)
LUA_API int lua_compare(lua_State *L, int index1, int index2, int op)
LUA_API void lua_createtable(lua_State *L, int narray, int nrec)
static void addfield(lua_State *L, luaL_Buffer *b, lua_Integer i)
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45