Defines | Functions | Variables

lua/ltablib.c File Reference

#include <stddef.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
Include dependency graph for ltablib.c:

Go to the source code of this file.

Defines

#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 []

Define Documentation

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

Definition at line 19 of file ltablib.c.

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

#define ltablib_c

Definition at line 10 of file ltablib.c.

#define LUA_LIB

Definition at line 11 of file ltablib.c.


Function Documentation

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

Definition at line 84 of file ltablib.c.

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

Referenced by tconcat().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 184 of file ltablib.c.

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

Referenced by sort().

Here is the call graph for this function:

Here is the caller graph for this function:

LUAMOD_API int luaopen_table ( lua_State L  ) 

Definition at line 274 of file ltablib.c.

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

Referenced by LuaKernel::LuaKernel().

Here is the call graph for this function:

Here is the caller graph for this function:

static int maxn ( lua_State L  )  [static]

Definition at line 24 of file ltablib.c.

References lua_next(), lua_pop, lua_pushnil(), lua_pushnumber(), LUA_TNUMBER, lua_tonumber, LUA_TTABLE, lua_type(), and luaL_checktype().

Here is the call graph for this function:

static int pack ( lua_State L  )  [static]

Definition at line 119 of file ltablib.c.

References lua_createtable(), lua_gettop(), lua_pushinteger(), lua_pushvalue(), lua_rawseti(), lua_replace(), and lua_setfield().

Here is the call graph for this function:

static void set2 ( lua_State L,
int  i,
int  j 
) [static]

Definition at line 164 of file ltablib.c.

References lua_rawseti().

Referenced by auxsort().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 169 of file ltablib.c.

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

Referenced by auxsort().

Here is the call graph for this function:

Here is the caller graph for this function:

static int tconcat ( lua_State L  )  [static]

Definition at line 93 of file ltablib.c.

References addfield(), LUA_TTABLE, luaL_addlstring(), luaL_buffinit(), luaL_checkint, luaL_checktype(), luaL_len(), luaL_opt, luaL_optint, luaL_optlstring(), and luaL_pushresult().

Here is the call graph for this function:

static int tinsert ( lua_State L  )  [static]

Definition at line 41 of file ltablib.c.

References aux_getn, lua_gettop(), LUA_QL, lua_rawgeti(), lua_rawseti(), luaL_checkint, luaL_error(), and pos.

Here is the call graph for this function:

static int tremove ( lua_State L  )  [static]

Definition at line 68 of file ltablib.c.

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

Here is the call graph for this function:

static int unpack ( lua_State L  )  [static]

Definition at line 136 of file ltablib.c.

References lua_checkstack(), lua_rawgeti(), LUA_TTABLE, luaL_checkint, luaL_checktype(), luaL_error(), luaL_len(), luaL_opt, and luaL_optint.

Here is the call graph for this function:


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}
}

Definition at line 260 of file ltablib.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:08:00 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs