Defines | Functions | Variables

lua/lbaselib.c 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.c:

Go to the source code of this file.

Defines

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

Define Documentation

#define lbaselib_c

Definition at line 14 of file lbaselib.c.

#define LUA_LIB

Definition at line 15 of file lbaselib.c.

#define RESERVEDSLOT   5

Definition at line 281 of file lbaselib.c.

Referenced by generic_reader(), and luaB_load().

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

Definition at line 46 of file lbaselib.c.

Referenced by luaB_tonumber().


Function Documentation

static int dofilecont ( lua_State L  )  [static]

Definition at line 332 of file lbaselib.c.

References lua_gettop().

Referenced by luaB_dofile().

Here is the call graph for this function:

Here is the caller graph for this function:

static int finishpcall ( lua_State L,
int  status 
) [static]

Definition at line 369 of file lbaselib.c.

References lua_checkstack(), lua_gettop(), lua_pushboolean(), lua_pushstring(), lua_replace(), and lua_settop().

Referenced by luaB_pcall(), luaB_xpcall(), and pcallcont().

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* generic_reader ( lua_State L,
void *  ud,
size_t *  size 
) [static]

Definition at line 290 of file lbaselib.c.

References lua_call, lua_isnil, lua_isstring(), lua_pushvalue(), lua_replace(), lua_tolstring(), luaL_checkstack(), luaL_error(), and RESERVEDSLOT.

Referenced by luaB_load().

Here is the call graph for this function:

Here is the caller graph for this function:

static int ipairsaux ( lua_State L  )  [static]

Definition at line 230 of file lbaselib.c.

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

Referenced by luaB_ipairs().

Here is the call graph for this function:

Here is the caller graph for this function:

static int load_aux ( lua_State L,
int  status 
) [static]

Definition at line 245 of file lbaselib.c.

References lua_insert(), LUA_OK, and lua_pushnil().

Referenced by luaB_load(), and luaB_loadfile().

Here is the call graph for this function:

Here is the caller graph for this function:

static int luaB_assert ( lua_State L  )  [static]

Definition at line 346 of file lbaselib.c.

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

Here is the call graph for this function:

static int luaB_collectgarbage ( lua_State L  )  [static]

Definition at line 160 of file lbaselib.c.

References lua_gc(), LUA_GCCOUNT, LUA_GCCOUNTB, LUA_GCINC, LUA_GCISRUNNING, LUA_GCSTEP, lua_pushboolean(), lua_pushinteger(), lua_pushnumber(), luaL_checkoption(), and luaL_optint.

Here is the call graph for this function:

static int luaB_dofile ( lua_State L  )  [static]

Definition at line 337 of file lbaselib.c.

References dofilecont(), lua_callk(), lua_error(), LUA_MULTRET, LUA_OK, lua_settop(), luaL_loadfile, and luaL_optstring.

Here is the call graph for this function:

static int luaB_error ( lua_State L  )  [static]

Definition at line 89 of file lbaselib.c.

References game_config::images::level, lua_concat(), lua_error(), lua_isstring(), lua_pushvalue(), lua_settop(), luaL_optint, and luaL_where().

Here is the call graph for this function:

static int luaB_getmetatable ( lua_State L  )  [static]

Definition at line 101 of file lbaselib.c.

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

Here is the call graph for this function:

static int luaB_ipairs ( lua_State L  )  [static]

Definition at line 240 of file lbaselib.c.

References ipairsaux(), and pairsmeta().

Here is the call graph for this function:

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

Definition at line 256 of file lbaselib.c.

References load_aux(), lua_isnone, LUA_OK, lua_pushvalue(), lua_setupvalue(), luaL_loadfilex(), and luaL_optstring.

Here is the call graph for this function:

static int luaB_next ( lua_State L  )  [static]

Definition at line 213 of file lbaselib.c.

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

Referenced by luaB_pairs().

Here is the call graph for this function:

Here is the caller graph for this function:

static int luaB_pairs ( lua_State L  )  [static]

Definition at line 225 of file lbaselib.c.

References luaB_next(), and pairsmeta().

Here is the call graph for this function:

static int luaB_pcall ( lua_State L  )  [static]

Definition at line 388 of file lbaselib.c.

References finishpcall(), lua_gettop(), lua_insert(), LUA_MULTRET, LUA_OK, lua_pcallk(), lua_pushnil(), luaL_checkany(), and pcallcont().

Here is the call graph for this function:

static int luaB_print ( lua_State L  )  [static]

Definition at line 23 of file lbaselib.c.

References lua_call, lua_getglobal(), lua_gettop(), lua_pop, lua_pushvalue(), LUA_QL, lua_tolstring(), and luaL_error().

Here is the call graph for this function:

static int luaB_rawequal ( lua_State L  )  [static]

Definition at line 125 of file lbaselib.c.

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

Here is the call graph for this function:

static int luaB_rawget ( lua_State L  )  [static]

Definition at line 142 of file lbaselib.c.

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

Here is the call graph for this function:

static int luaB_rawlen ( lua_State L  )  [static]

Definition at line 133 of file lbaselib.c.

References lua_pushinteger(), lua_rawlen(), LUA_TSTRING, LUA_TTABLE, lua_type(), and luaL_argcheck.

Here is the call graph for this function:

static int luaB_rawset ( lua_State L  )  [static]

Definition at line 150 of file lbaselib.c.

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

Here is the call graph for this function:

static int luaB_select ( lua_State L  )  [static]

Definition at line 353 of file lbaselib.c.

References lua_gettop(), lua_pushinteger(), lua_tostring, LUA_TSTRING, lua_type(), luaL_argcheck, and luaL_checkint.

Here is the call graph for this function:

static int luaB_setmetatable ( lua_State L  )  [static]

Definition at line 112 of file lbaselib.c.

References lua_setmetatable(), lua_settop(), LUA_TNIL, LUA_TTABLE, lua_type(), luaL_argcheck, luaL_checktype(), luaL_error(), and luaL_getmetafield().

Here is the call graph for this function:

static int luaB_tonumber ( lua_State L  )  [static]

Definition at line 48 of file lbaselib.c.

References lua_isnoneornil, lua_pushnil(), lua_pushnumber(), lua_tonumberx(), luaL_argcheck, luaL_checkany(), luaL_checkint, luaL_checklstring(), and SPACECHARS.

Here is the call graph for this function:

static int luaB_tostring ( lua_State L  )  [static]

Definition at line 410 of file lbaselib.c.

References luaL_checkany(), and luaL_tolstring().

Here is the call graph for this function:

static int luaB_type ( lua_State L  )  [static]

Definition at line 189 of file lbaselib.c.

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

Here is the call graph for this function:

static int luaB_xpcall ( lua_State L  )  [static]

Definition at line 398 of file lbaselib.c.

References finishpcall(), lua_copy(), lua_gettop(), LUA_MULTRET, LUA_OK, lua_pcallk(), lua_pushvalue(), lua_replace(), luaL_argcheck, and pcallcont().

Here is the call graph for this function:

LUAMOD_API int luaopen_base ( lua_State L  ) 

Definition at line 447 of file lbaselib.c.

References lua_pushglobaltable, lua_pushliteral, lua_setfield(), LUA_VERSION, and luaL_setfuncs().

Referenced by LuaKernel::LuaKernel().

Here is the call graph for this function:

Here is the caller graph for this function:

static int pairsmeta ( lua_State L,
const char *  method,
int  iszero,
lua_CFunction  iter 
) [static]

Definition at line 196 of file lbaselib.c.

References lua_call, lua_pushcfunction, lua_pushinteger(), lua_pushnil(), lua_pushvalue(), LUA_TTABLE, luaL_checktype(), and luaL_getmetafield().

Referenced by luaB_ipairs(), and luaB_pairs().

Here is the call graph for this function:

Here is the caller graph for this function:

static int pcallcont ( lua_State L  )  [static]

Definition at line 382 of file lbaselib.c.

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

Referenced by luaB_pcall(), and luaB_xpcall().

Here is the call graph for this function:

Here is the caller graph for this function:


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

Definition at line 417 of file lbaselib.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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