The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Macros | Functions | Variables
ltablib.cpp File Reference
#include <stddef.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
Include dependency graph for ltablib.cpp:

Go to the source code of this file.

Macros

#define ltablib_c
 
#define LUA_LIB
 
#define aux_getn(L, n)   (luaL_checktype(L, n, LUA_TTABLE), luaL_len(L, n))
 

Functions

static int maxn (lua_State *L)
 
static int tinsert (lua_State *L)
 
static int tremove (lua_State *L)
 
static void addfield (lua_State *L, luaL_Buffer *b, int i)
 
static int tconcat (lua_State *L)
 
static int pack (lua_State *L)
 
static int unpack (lua_State *L)
 
static void set2 (lua_State *L, int i, int j)
 
static int sort_comp (lua_State *L, int a, int b)
 
static void auxsort (lua_State *L, int l, int u)
 
static int sort (lua_State *L)
 
LUAMOD_API int luaopen_table (lua_State *L)
 

Variables

static const luaL_Reg tab_funcs []
 

Macro Definition Documentation

#define aux_getn (   L,
  n 
)    (luaL_checktype(L, n, LUA_TTABLE), luaL_len(L, n))

Definition at line 18 of file ltablib.cpp.

Referenced by sort(), tinsert(), and tremove().

#define ltablib_c

Definition at line 9 of file ltablib.cpp.

#define LUA_LIB

Definition at line 10 of file ltablib.cpp.

Function Documentation

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

Definition at line 83 of file ltablib.cpp.

References lua_isstring(), LUA_QL, lua_rawgeti(), luaL_addvalue(), luaL_error(), and luaL_typename.

Referenced by tconcat().

static void auxsort ( lua_State L,
int  l,
int  u 
)
static

Definition at line 183 of file ltablib.cpp.

References i, lua_pop, lua_pushvalue(), lua_rawgeti(), luaL_error(), set2(), and sort_comp().

Referenced by sort().

LUAMOD_API int luaopen_table ( lua_State L)

Definition at line 273 of file ltablib.cpp.

References lua_getfield(), lua_setglobal(), and luaL_newlib.

Referenced by lua_kernel_base::lua_kernel_base().

static int maxn ( lua_State L)
static
static int pack ( lua_State L)
static
static void set2 ( lua_State L,
int  i,
int  j 
)
static

Definition at line 163 of file ltablib.cpp.

References lua_rawseti().

Referenced by auxsort().

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

Definition at line 168 of file ltablib.cpp.

References lua_call, lua_compare(), lua_isnil, LUA_OPLT, lua_pop, lua_pushvalue(), and lua_toboolean().

Referenced by auxsort().

static int tconcat ( lua_State L)
static
static int tinsert ( lua_State L)
static
static int tremove ( lua_State L)
static

Definition at line 67 of file ltablib.cpp.

References aux_getn, lua_pushnil(), lua_rawgeti(), lua_rawseti(), luaL_argcheck, luaL_optint, and pos.

static int unpack ( lua_State L)
static

Variable Documentation

const luaL_Reg tab_funcs[]
static
Initial value:
= {
{"concat", tconcat},
{"maxn", maxn},
{"insert", tinsert},
{"pack", pack},
{"unpack", unpack},
{"remove", tremove},
{"sort", sort},
{NULL, NULL}
}
static int pack(lua_State *L)
Definition: ltablib.cpp:118
static int unpack(lua_State *L)
Definition: ltablib.cpp:135
static int tinsert(lua_State *L)
Definition: ltablib.cpp:40
static int tconcat(lua_State *L)
Definition: ltablib.cpp:92
static int tremove(lua_State *L)
Definition: ltablib.cpp:67
static int sort(lua_State *L)
Definition: ltablib.cpp:246
static int maxn(lua_State *L)
Definition: ltablib.cpp:23

Definition at line 259 of file ltablib.cpp.