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

Go to the source code of this file.

Macros

#define lbaselib_c
 
#define LUA_LIB
 
#define SPACECHARS   " \f\n\r\t\v"
 
#define RESERVEDSLOT   5
 

Functions

static int luaB_print (lua_State *L)
 
static int luaB_tonumber (lua_State *L)
 
static int luaB_error (lua_State *L)
 
static int luaB_getmetatable (lua_State *L)
 
static int luaB_setmetatable (lua_State *L)
 
static int luaB_rawequal (lua_State *L)
 
static int luaB_rawlen (lua_State *L)
 
static int luaB_rawget (lua_State *L)
 
static int luaB_rawset (lua_State *L)
 
static int luaB_collectgarbage (lua_State *L)
 
static int luaB_type (lua_State *L)
 
static int pairsmeta (lua_State *L, const char *method, int iszero, lua_CFunction iter)
 
static int luaB_next (lua_State *L)
 
static int luaB_pairs (lua_State *L)
 
static int ipairsaux (lua_State *L)
 
static int luaB_ipairs (lua_State *L)
 
static int load_aux (lua_State *L, int status, int envidx)
 
static int luaB_loadfile (lua_State *L)
 
static const char * generic_reader (lua_State *L, void *ud, size_t *size)
 
static int luaB_load (lua_State *L)
 
static int dofilecont (lua_State *L)
 
static int luaB_dofile (lua_State *L)
 
static int luaB_assert (lua_State *L)
 
static int luaB_select (lua_State *L)
 
static int finishpcall (lua_State *L, int status)
 
static int pcallcont (lua_State *L)
 
static int luaB_pcall (lua_State *L)
 
static int luaB_xpcall (lua_State *L)
 
static int luaB_tostring (lua_State *L)
 
LUAMOD_API int luaopen_base (lua_State *L)
 

Variables

static const luaL_Reg base_funcs []
 

Macro Definition Documentation

#define lbaselib_c

Definition at line 13 of file lbaselib.cpp.

#define LUA_LIB

Definition at line 14 of file lbaselib.cpp.

#define RESERVEDSLOT   5

Definition at line 282 of file lbaselib.cpp.

Referenced by generic_reader(), and luaB_load().

#define SPACECHARS   " \f\n\r\t\v"

Definition at line 45 of file lbaselib.cpp.

Referenced by luaB_tonumber().

Function Documentation

static int dofilecont ( lua_State L)
static

Definition at line 330 of file lbaselib.cpp.

References lua_gettop().

Referenced by luaB_dofile().

static int finishpcall ( lua_State L,
int  status 
)
static
static const char* generic_reader ( lua_State L,
void ud,
size_t *  size 
)
static
static int ipairsaux ( lua_State L)
static

Definition at line 229 of file lbaselib.cpp.

References i, lua_isnil, lua_pushinteger(), lua_rawgeti(), LUA_TTABLE, luaL_checkint, and luaL_checktype().

Referenced by luaB_ipairs().

static int load_aux ( lua_State L,
int  status,
int  envidx 
)
static

Definition at line 244 of file lbaselib.cpp.

References lua_insert(), LUA_OK, lua_pop, lua_pushnil(), lua_pushvalue(), and lua_setupvalue().

Referenced by luaB_load(), and luaB_loadfile().

static int luaB_assert ( lua_State L)
static

Definition at line 345 of file lbaselib.cpp.

References lua_gettop(), lua_toboolean(), luaL_error(), and luaL_optstring.

static int luaB_collectgarbage ( lua_State L)
static
static int luaB_dofile ( lua_State L)
static
static int luaB_error ( lua_State L)
static
static int luaB_getmetatable ( lua_State L)
static

Definition at line 100 of file lbaselib.cpp.

References lua_getmetatable(), lua_pushnil(), luaL_checkany(), and luaL_getmetafield().

static int luaB_ipairs ( lua_State L)
static

Definition at line 239 of file lbaselib.cpp.

References ipairsaux(), and pairsmeta().

static int luaB_load ( lua_State L)
static
static int luaB_loadfile ( lua_State L)
static

Definition at line 261 of file lbaselib.cpp.

References load_aux(), lua_isnone, luaL_loadfilex(), and luaL_optstring.

static int luaB_next ( lua_State L)
static

Definition at line 212 of file lbaselib.cpp.

References lua_next(), lua_pushnil(), lua_settop(), LUA_TTABLE, and luaL_checktype().

Referenced by luaB_pairs().

static int luaB_pairs ( lua_State L)
static

Definition at line 224 of file lbaselib.cpp.

References luaB_next(), and pairsmeta().

static int luaB_pcall ( lua_State L)
static
static int luaB_print ( lua_State L)
static
static int luaB_rawequal ( lua_State L)
static

Definition at line 124 of file lbaselib.cpp.

References lua_pushboolean(), lua_rawequal(), and luaL_checkany().

static int luaB_rawget ( lua_State L)
static

Definition at line 141 of file lbaselib.cpp.

References lua_rawget(), lua_settop(), LUA_TTABLE, luaL_checkany(), and luaL_checktype().

static int luaB_rawlen ( lua_State L)
static
static int luaB_rawset ( lua_State L)
static

Definition at line 149 of file lbaselib.cpp.

References lua_rawset(), lua_settop(), LUA_TTABLE, luaL_checkany(), and luaL_checktype().

static int luaB_select ( lua_State L)
static
static int luaB_setmetatable ( lua_State L)
static
static int luaB_tonumber ( lua_State L)
static
static int luaB_tostring ( lua_State L)
static

Definition at line 409 of file lbaselib.cpp.

References luaL_checkany(), and luaL_tolstring().

static int luaB_type ( lua_State L)
static

Definition at line 188 of file lbaselib.cpp.

References lua_pushstring(), luaL_checkany(), and luaL_typename.

static int luaB_xpcall ( lua_State L)
static
LUAMOD_API int luaopen_base ( lua_State L)
static int pairsmeta ( lua_State L,
const char *  method,
int  iszero,
lua_CFunction  iter 
)
static
static int pcallcont ( lua_State L)
static

Definition at line 381 of file lbaselib.cpp.

References finishpcall(), lua_getctx(), and LUA_YIELD.

Referenced by luaB_pcall(), and luaB_xpcall().

Variable Documentation

const luaL_Reg base_funcs[]
static
Initial value:
= {
{"assert", luaB_assert},
{"collectgarbage", luaB_collectgarbage},
{"dofile", luaB_dofile},
{"error", luaB_error},
{"getmetatable", luaB_getmetatable},
{"ipairs", luaB_ipairs},
{"loadfile", luaB_loadfile},
{"load", luaB_load},
{"loadstring", luaB_load},
{"next", luaB_next},
{"pairs", luaB_pairs},
{"pcall", luaB_pcall},
{"print", luaB_print},
{"rawequal", luaB_rawequal},
{"rawlen", luaB_rawlen},
{"rawget", luaB_rawget},
{"rawset", luaB_rawset},
{"select", luaB_select},
{"setmetatable", luaB_setmetatable},
{"tonumber", luaB_tonumber},
{"tostring", luaB_tostring},
{"type", luaB_type},
{"xpcall", luaB_xpcall},
{NULL, NULL}
}
static int luaB_select(lua_State *L)
Definition: lbaselib.cpp:352
static int luaB_pcall(lua_State *L)
Definition: lbaselib.cpp:387
static int luaB_next(lua_State *L)
Definition: lbaselib.cpp:212
static int luaB_xpcall(lua_State *L)
Definition: lbaselib.cpp:397
static int luaB_ipairs(lua_State *L)
Definition: lbaselib.cpp:239
static int luaB_print(lua_State *L)
Definition: lbaselib.cpp:22
static int luaB_pairs(lua_State *L)
Definition: lbaselib.cpp:224
static int luaB_dofile(lua_State *L)
Definition: lbaselib.cpp:335
static int luaB_tonumber(lua_State *L)
Definition: lbaselib.cpp:47
static int luaB_load(lua_State *L)
Definition: lbaselib.cpp:308
static int luaB_setmetatable(lua_State *L)
Definition: lbaselib.cpp:111
static int luaB_rawequal(lua_State *L)
Definition: lbaselib.cpp:124
static int luaB_getmetatable(lua_State *L)
Definition: lbaselib.cpp:100
static int luaB_assert(lua_State *L)
Definition: lbaselib.cpp:345
static int luaB_rawlen(lua_State *L)
Definition: lbaselib.cpp:132
static int luaB_collectgarbage(lua_State *L)
Definition: lbaselib.cpp:159
static int luaB_tostring(lua_State *L)
Definition: lbaselib.cpp:409
static int luaB_rawget(lua_State *L)
Definition: lbaselib.cpp:141
static int luaB_type(lua_State *L)
Definition: lbaselib.cpp:188
static int luaB_loadfile(lua_State *L)
Definition: lbaselib.cpp:261
static int luaB_error(lua_State *L)
Definition: lbaselib.cpp:88
static int luaB_rawset(lua_State *L)
Definition: lbaselib.cpp:149

Definition at line 416 of file lbaselib.cpp.