RetroArch
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:

Macros

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

Typedefs

typedef unsigned int IdxT
 

Functions

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

Variables

static const luaL_Reg tab_funcs []
 

Macro Definition Documentation

◆ aux_getn

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

◆ ltablib_c

#define ltablib_c

◆ LUA_LIB

#define LUA_LIB

◆ RANLIMIT

#define RANLIMIT   100u

◆ sof

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

◆ TAB_L

#define TAB_L   4 /* length */

◆ TAB_R

#define TAB_R   1 /* read */

◆ TAB_RW

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

◆ TAB_W

#define TAB_W   2 /* write */

Typedef Documentation

◆ IdxT

typedef unsigned int IdxT

Function Documentation

◆ addfield()

static void addfield ( lua_State L,
luaL_Buffer b,
lua_Integer  i 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ auxsort()

static void auxsort ( lua_State L,
IdxT  lo,
IdxT  up,
unsigned int  rnd 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkfield()

static int checkfield ( lua_State L,
const char *  key,
int  n 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ checktab()

static void checktab ( lua_State L,
int  arg,
int  what 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ choosePivot()

static IdxT choosePivot ( IdxT  lo,
IdxT  up,
unsigned int  rnd 
)
static
Here is the caller graph for this function:

◆ l_randomizePivot()

static unsigned int l_randomizePivot ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ luaopen_table()

LUAMOD_API int luaopen_table ( lua_State L)
Here is the call graph for this function:

◆ pack()

static int pack ( lua_State L)
static
Here is the call graph for this function:

◆ partition()

static IdxT partition ( lua_State L,
IdxT  lo,
IdxT  up 
)
static
Here is the call graph for this function:

◆ set2()

static void set2 ( lua_State L,
IdxT  i,
IdxT  j 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sort()

static int sort ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sort_comp()

static int sort_comp ( lua_State L,
int  a,
int  b 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tconcat()

static int tconcat ( lua_State L)
static
Here is the call graph for this function:

◆ tinsert()

static int tinsert ( lua_State L)
static
Here is the call graph for this function:

◆ tmove()

static int tmove ( lua_State L)
static
Here is the call graph for this function:

◆ tremove()

static int tremove ( lua_State L)
static
Here is the call graph for this function:

◆ unpack()

static int unpack ( lua_State L)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ tab_funcs

const luaL_Reg tab_funcs[]
static
Initial value:
= {
{"concat", tconcat},
{"insert", tinsert},
{"pack", pack},
{"unpack", unpack},
{"remove", tremove},
{"move", tmove},
{"sort", sort},
}
static int tinsert(lua_State *L)
Definition: ltablib.c:79
static int pack(lua_State *L)
Definition: ltablib.c:194
static int tremove(lua_State *L)
Definition: ltablib.c:106
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static int tmove(lua_State *L)
Definition: ltablib.c:128
static int unpack(lua_State *L)
Definition: ltablib.c:207
static int tconcat(lua_State *L)
Definition: ltablib.c:169
static int sort(lua_State *L)
Definition: ltablib.c:411