Macros | Typedefs | Functions | Variables
ltablib.c File Reference
#include "lprefix.h"
#include <limits.h>
#include <stddef.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
#include <time.h>
Include dependency graph for ltablib.c:

Go to the source code of this file.

Macros

#define aux_getn(L, n, w)   (checktab(L, n, (w) | TAB_L), luaL_len(L, n))
 
#define ltablib_c
 
#define LUA_LIB
 
#define RANLIMIT   100u
 
#define sof(e)   (sizeof(e) / sizeof(unsigned int))
 
#define TAB_L   4 /* length */
 
#define TAB_R   1 /* read */
 
#define TAB_RW   (TAB_R | TAB_W) /* read/write */
 
#define TAB_W   2 /* write */
 

Typedefs

typedef unsigned int IdxT
 

Functions

static void addfield (lua_State *L, luaL_Buffer *b, lua_Integer i)
 
static void auxsort (lua_State *L, IdxT lo, IdxT up, unsigned int rnd)
 
static int checkfield (lua_State *L, const char *key, int n)
 
static void checktab (lua_State *L, int arg, int what)
 
static IdxT choosePivot (IdxT lo, IdxT up, unsigned int rnd)
 
static unsigned int l_randomizePivot (void)
 
LUAMOD_API int luaopen_table (lua_State *L)
 
static IdxT partition (lua_State *L, IdxT lo, IdxT up)
 
static void set2 (lua_State *L, IdxT i, IdxT j)
 
static int sort (lua_State *L)
 
static int sort_comp (lua_State *L, int a, int b)
 
static int tconcat (lua_State *L)
 
static int tinsert (lua_State *L)
 
static int tmove (lua_State *L)
 
static int tpack (lua_State *L)
 
static int tremove (lua_State *L)
 
static int tunpack (lua_State *L)
 

Variables

static const luaL_Reg tab_funcs []
 

Macro Definition Documentation

◆ aux_getn

#define aux_getn (   L,
  n,
 
)    (checktab(L, n, (w) | TAB_L), luaL_len(L, n))

Definition at line 33 of file ltablib.c.

◆ ltablib_c

#define ltablib_c

Definition at line 7 of file ltablib.c.

◆ LUA_LIB

#define LUA_LIB

Definition at line 8 of file ltablib.c.

◆ RANLIMIT

#define RANLIMIT   100u

Definition at line 261 of file ltablib.c.

◆ sof

#define sof (   e)    (sizeof(e) / sizeof(unsigned int))

Definition at line 237 of file ltablib.c.

◆ TAB_L

#define TAB_L   4 /* length */

Definition at line 29 of file ltablib.c.

◆ TAB_R

#define TAB_R   1 /* read */

Definition at line 27 of file ltablib.c.

◆ TAB_RW

#define TAB_RW   (TAB_R | TAB_W) /* read/write */

Definition at line 30 of file ltablib.c.

◆ TAB_W

#define TAB_W   2 /* write */

Definition at line 28 of file ltablib.c.

Typedef Documentation

◆ IdxT

typedef unsigned int IdxT

Definition at line 223 of file ltablib.c.

Function Documentation

◆ addfield()

static void addfield ( lua_State L,
luaL_Buffer b,
lua_Integer  i 
)
static

Definition at line 146 of file ltablib.c.

◆ auxsort()

static void auxsort ( lua_State L,
IdxT  lo,
IdxT  up,
unsigned int  rnd 
)
static

Definition at line 344 of file ltablib.c.

◆ checkfield()

static int checkfield ( lua_State L,
const char *  key,
int  n 
)
static

Definition at line 36 of file ltablib.c.

◆ checktab()

static void checktab ( lua_State L,
int  arg,
int  what 
)
static

Definition at line 46 of file ltablib.c.

◆ choosePivot()

static IdxT choosePivot ( IdxT  lo,
IdxT  up,
unsigned int  rnd 
)
static

Definition at line 333 of file ltablib.c.

◆ l_randomizePivot()

static unsigned int l_randomizePivot ( void  )
static

Definition at line 245 of file ltablib.c.

◆ luaopen_table()

LUAMOD_API int luaopen_table ( lua_State L)

Definition at line 425 of file ltablib.c.

◆ partition()

static IdxT partition ( lua_State L,
IdxT  lo,
IdxT  up 
)
static

Definition at line 297 of file ltablib.c.

◆ set2()

static void set2 ( lua_State L,
IdxT  i,
IdxT  j 
)
static

Definition at line 264 of file ltablib.c.

◆ sort()

static int sort ( lua_State L)
static

Definition at line 398 of file ltablib.c.

◆ sort_comp()

static int sort_comp ( lua_State L,
int  a,
int  b 
)
static

Definition at line 274 of file ltablib.c.

◆ tconcat()

static int tconcat ( lua_State L)
static

Definition at line 155 of file ltablib.c.

◆ tinsert()

static int tinsert ( lua_State L)
static

Definition at line 61 of file ltablib.c.

◆ tmove()

static int tmove ( lua_State L)
static

Definition at line 114 of file ltablib.c.

◆ tpack()

static int tpack ( lua_State L)
static

Definition at line 180 of file ltablib.c.

◆ tremove()

static int tremove ( lua_State L)
static

Definition at line 90 of file ltablib.c.

◆ tunpack()

static int tunpack ( lua_State L)
static

Definition at line 193 of file ltablib.c.

Variable Documentation

◆ tab_funcs

const luaL_Reg tab_funcs[]
static
Initial value:
= {
{"concat", tconcat},
{"insert", tinsert},
{"pack", tpack},
{"unpack", tunpack},
{"remove", tremove},
{"move", tmove},
{"sort", sort},
{NULL, NULL}
}

Definition at line 413 of file ltablib.c.

tmove
static int tmove(lua_State *L)
Definition: ltablib.c:114
tpack
static int tpack(lua_State *L)
Definition: ltablib.c:180
tremove
static int tremove(lua_State *L)
Definition: ltablib.c:90
tconcat
static int tconcat(lua_State *L)
Definition: ltablib.c:155
tinsert
static int tinsert(lua_State *L)
Definition: ltablib.c:61
sort
static int sort(lua_State *L)
Definition: ltablib.c:398
tunpack
static int tunpack(lua_State *L)
Definition: ltablib.c:193


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:49