lbaselib.cpp File Reference

#include <common/Logger.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"

Go to the source code of this file.

Defines

#define lbaselib_c
#define LUA_LIB

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 void getfunc (lua_State *L, int opt)
static int luaB_getfenv (lua_State *L)
static int luaB_setfenv (lua_State *L)
static int luaB_rawequal (lua_State *L)
static int luaB_rawget (lua_State *L)
static int luaB_rawset (lua_State *L)
static int luaB_gcinfo (lua_State *L)
static int luaB_collectgarbage (lua_State *L)
static int luaB_type (lua_State *L)
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_loadstring (lua_State *L)
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 luaB_dofile (lua_State *L)
static int luaB_assert (lua_State *L)
static int luaB_unpack (lua_State *L)
static int luaB_select (lua_State *L)
static int luaB_pcall (lua_State *L)
static int luaB_xpcall (lua_State *L)
static int luaB_tostring (lua_State *L)
static int luaB_newproxy (lua_State *L)
static int auxresume (lua_State *L, lua_State *co, int narg)
static int luaB_coresume (lua_State *L)
static int luaB_auxwrap (lua_State *L)
static int luaB_cocreate (lua_State *L)
static int luaB_cowrap (lua_State *L)
static int luaB_yield (lua_State *L)
static int luaB_costatus (lua_State *L)
static int luaB_corunning (lua_State *L)
static void auxopen (lua_State *L, const char *name, lua_CFunction f, lua_CFunction u)
static void base_open (lua_State *L)
LUALIB_API int luaopen_base (lua_State *L)

Variables

static const luaL_Reg base_funcs []
static const luaL_Reg co_funcs []


Define Documentation

#define lbaselib_c

Definition at line 14 of file lbaselib.cpp.

#define LUA_LIB

Definition at line 15 of file lbaselib.cpp.


Function Documentation

static void auxopen ( lua_State L,
const char *  name,
lua_CFunction  f,
lua_CFunction  u 
) [static]

Definition at line 613 of file lbaselib.cpp.

References lua_pushcclosure(), lua_pushcfunction, and lua_setfield().

Referenced by base_open().

static int auxresume ( lua_State L,
lua_State co,
int  narg 
) [static]

Definition at line 485 of file lbaselib.cpp.

References lua_checkstack(), lua_gettop(), lua_pushliteral, lua_resume(), lua_status(), lua_xmove(), LUA_YIELD, and luaL_error().

Referenced by luaB_auxwrap(), and luaB_coresume().

static void base_open ( lua_State L  )  [static]

Definition at line 621 of file lbaselib.cpp.

References auxopen(), ipairsaux(), lua_createtable(), LUA_GLOBALSINDEX, lua_pushcclosure(), lua_pushliteral, lua_pushvalue(), lua_setfield(), lua_setglobal, lua_setmetatable(), LUA_VERSION, luaB_ipairs(), luaB_newproxy(), luaB_next(), luaB_pairs(), and luaL_register().

Referenced by luaopen_base().

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

Definition at line 301 of file lbaselib.cpp.

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

Referenced by luaB_load().

static void getfunc ( lua_State L,
int  opt 
) [static]

Definition at line 121 of file lbaselib.cpp.

References lua_getinfo(), lua_getstack(), lua_isfunction, lua_isnil, lua_pushvalue(), luaL_argcheck, luaL_argerror(), luaL_checkint, luaL_error(), and luaL_optint.

Referenced by luaB_getfenv(), and luaB_setfenv().

static int ipairsaux ( lua_State L  )  [static]

Definition at line 251 of file lbaselib.cpp.

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

Referenced by base_open().

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

Definition at line 270 of file lbaselib.cpp.

References lua_insert(), and lua_pushnil().

Referenced by luaB_load(), luaB_loadfile(), and luaB_loadstring().

static int luaB_assert ( lua_State L  )  [static]

Definition at line 338 of file lbaselib.cpp.

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

static int luaB_auxwrap ( lua_State L  )  [static]

Definition at line 527 of file lbaselib.cpp.

References auxresume(), lua_concat(), lua_error(), lua_gettop(), lua_insert(), lua_isstring(), lua_tothread(), lua_upvalueindex, and luaL_where().

Referenced by luaB_cowrap().

static int luaB_cocreate ( lua_State L  )  [static]

Definition at line 542 of file lbaselib.cpp.

References lua_iscfunction(), lua_isfunction, lua_newthread(), lua_pushvalue(), lua_xmove(), and luaL_argcheck.

Referenced by luaB_cowrap().

static int luaB_collectgarbage ( lua_State L  )  [static]

Definition at line 197 of file lbaselib.cpp.

References lua_gc(), LUA_GCCOLLECT, LUA_GCCOUNT, LUA_GCCOUNTB, LUA_GCRESTART, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL, LUA_GCSTEP, LUA_GCSTOP, lua_pushboolean(), lua_pushnumber(), luaL_checkoption(), luaL_optint, and NULL.

static int luaB_coresume ( lua_State L  )  [static]

Definition at line 509 of file lbaselib.cpp.

References auxresume(), lua_gettop(), lua_insert(), lua_pushboolean(), lua_tothread(), and luaL_argcheck.

static int luaB_corunning ( lua_State L  )  [static]

Definition at line 592 of file lbaselib.cpp.

References lua_pushthread().

static int luaB_costatus ( lua_State L  )  [static]

Definition at line 564 of file lbaselib.cpp.

References lua_getstack(), lua_gettop(), lua_pushliteral, lua_status(), lua_tothread(), LUA_YIELD, and luaL_argcheck.

static int luaB_cowrap ( lua_State L  )  [static]

Definition at line 552 of file lbaselib.cpp.

References lua_pushcclosure(), luaB_auxwrap(), and luaB_cocreate().

static int luaB_dofile ( lua_State L  )  [static]

Definition at line 329 of file lbaselib.cpp.

References lua_call(), lua_error(), lua_gettop(), LUA_MULTRET, luaL_loadfile(), luaL_optstring, and NULL.

static int luaB_error ( lua_State L  )  [static]

Definition at line 85 of file lbaselib.cpp.

References lua_concat(), lua_error(), lua_isstring(), lua_pushvalue(), lua_settop(), luaL_optint, and luaL_where().

static int luaB_gcinfo ( lua_State L  )  [static]

Definition at line 191 of file lbaselib.cpp.

References lua_getgccount, and lua_pushinteger().

static int luaB_getfenv ( lua_State L  )  [static]

Definition at line 137 of file lbaselib.cpp.

References getfunc(), lua_getfenv(), LUA_GLOBALSINDEX, lua_iscfunction(), and lua_pushvalue().

static int luaB_getmetatable ( lua_State L  )  [static]

Definition at line 97 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 261 of file lbaselib.cpp.

References lua_pushinteger(), lua_pushvalue(), LUA_TTABLE, lua_upvalueindex, and luaL_checktype().

Referenced by base_open().

static int luaB_load ( lua_State L  )  [static]

Definition at line 319 of file lbaselib.cpp.

References generic_reader(), load_aux(), lua_load(), lua_settop(), LUA_TFUNCTION, luaL_checktype(), luaL_optstring, and NULL.

static int luaB_loadfile ( lua_State L  )  [static]

Definition at line 289 of file lbaselib.cpp.

References load_aux(), luaL_loadfile(), luaL_optstring, and NULL.

static int luaB_loadstring ( lua_State L  )  [static]

Definition at line 281 of file lbaselib.cpp.

References load_aux(), luaL_checklstring(), luaL_loadbuffer(), and luaL_optstring.

static int luaB_newproxy ( lua_State L  )  [static]

Definition at line 423 of file lbaselib.cpp.

References lua_getmetatable(), lua_isboolean, lua_newtable, lua_newuserdata(), lua_pop, lua_pushboolean(), lua_pushvalue(), lua_rawget(), lua_rawset(), lua_setmetatable(), lua_settop(), lua_toboolean(), lua_upvalueindex, and luaL_argcheck.

Referenced by base_open().

static int luaB_next ( lua_State L  )  [static]

Definition at line 230 of file lbaselib.cpp.

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

Referenced by base_open().

static int luaB_pairs ( lua_State L  )  [static]

Definition at line 242 of file lbaselib.cpp.

References lua_pushnil(), lua_pushvalue(), LUA_TTABLE, lua_upvalueindex, and luaL_checktype().

Referenced by base_open().

static int luaB_pcall ( lua_State L  )  [static]

Definition at line 376 of file lbaselib.cpp.

References lua_gettop(), lua_insert(), LUA_MULTRET, lua_pcall(), lua_pushboolean(), and luaL_checkany().

static int luaB_print ( lua_State L  )  [static]

Definition at line 31 of file lbaselib.cpp.

References Logger::log(), lua_call(), lua_getglobal, lua_gettop(), lua_pop, lua_pushvalue(), LUA_QL, lua_tostring, luaL_error(), and NULL.

static int luaB_rawequal ( lua_State L  )  [static]

Definition at line 165 of file lbaselib.cpp.

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

static int luaB_rawget ( lua_State L  )  [static]

Definition at line 173 of file lbaselib.cpp.

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

static int luaB_rawset ( lua_State L  )  [static]

Definition at line 181 of file lbaselib.cpp.

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

static int luaB_select ( lua_State L  )  [static]

Definition at line 360 of file lbaselib.cpp.

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

static int luaB_setfenv ( lua_State L  )  [static]

Definition at line 147 of file lbaselib.cpp.

References getfunc(), lua_insert(), lua_iscfunction(), lua_isnumber(), lua_pushthread(), lua_pushvalue(), LUA_QL, lua_setfenv(), lua_tonumber(), LUA_TTABLE, luaL_checktype(), and luaL_error().

static int luaB_setmetatable ( lua_State L  )  [static]

Definition at line 108 of file lbaselib.cpp.

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

static int luaB_tonumber ( lua_State L  )  [static]

Definition at line 57 of file lbaselib.cpp.

References lua_isnumber(), lua_pushnil(), lua_pushnumber(), lua_tonumber(), luaL_argcheck, luaL_checkany(), luaL_checkstring, and luaL_optint.

static int luaB_tostring ( lua_State L  )  [static]

Definition at line 398 of file lbaselib.cpp.

References lua_pushfstring(), lua_pushliteral, lua_pushstring(), lua_pushvalue(), LUA_TBOOLEAN, LUA_TNIL, LUA_TNUMBER, lua_toboolean(), lua_topointer(), lua_tostring, LUA_TSTRING, lua_type(), luaL_callmeta(), luaL_checkany(), and luaL_typename.

static int luaB_type ( lua_State L  )  [static]

Definition at line 223 of file lbaselib.cpp.

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

static int luaB_unpack ( lua_State L  )  [static]

Definition at line 346 of file lbaselib.cpp.

References lua_rawgeti(), LUA_TTABLE, luaL_checkint, luaL_checkstack(), luaL_checktype(), luaL_getn, luaL_opt, and luaL_optint.

static int luaB_xpcall ( lua_State L  )  [static]

Definition at line 386 of file lbaselib.cpp.

References lua_gettop(), lua_insert(), LUA_MULTRET, lua_pcall(), lua_pushboolean(), lua_replace(), lua_settop(), and luaL_checkany().

static int luaB_yield ( lua_State L  )  [static]

Definition at line 559 of file lbaselib.cpp.

References lua_gettop(), and lua_yield().

LUALIB_API int luaopen_base ( lua_State L  ) 

Definition at line 643 of file lbaselib.cpp.

Referenced by LUAScript::LUAScript().


Variable Documentation

const luaL_Reg base_funcs[] [static]

Initial value:

 {
  {"assert", luaB_assert},
  {"collectgarbage", luaB_collectgarbage},
  {"dofile", luaB_dofile},
  {"error", luaB_error},
  {"gcinfo", luaB_gcinfo},
  {"getfenv", luaB_getfenv},
  {"getmetatable", luaB_getmetatable},
  {"loadfile", luaB_loadfile},
  {"load", luaB_load},
  {"loadstring", luaB_loadstring},
  {"next", luaB_next},
  {"pcall", luaB_pcall},
  {"print", luaB_print},
  {"log", luaB_print},
  {"rawequal", luaB_rawequal},
  {"rawget", luaB_rawget},
  {"rawset", luaB_rawset},
  {"select", luaB_select},
  {"setfenv", luaB_setfenv},
  {"setmetatable", luaB_setmetatable},
  {"tonumber", luaB_tonumber},
  {"tostring", luaB_tostring},
  {"type", luaB_type},
  {"unpack", luaB_unpack},
  {"xpcall", luaB_xpcall},
  {NULL, NULL}
}

Definition at line 449 of file lbaselib.cpp.

const luaL_Reg co_funcs[] [static]

Initial value:

 {
  {"create", luaB_cocreate},
  {"resume", luaB_coresume},
  {"running", luaB_corunning},
  {"status", luaB_costatus},
  {"wrap", luaB_cowrap},
  {"yield", luaB_yield},
  {NULL, NULL}
}

Definition at line 600 of file lbaselib.cpp.


Generated on Mon Feb 16 15:14:58 2009 for Scorched3D by  doxygen 1.5.3