Go to the source code of this file.
Defines | |
#define | lbaselib_c |
#define | LUA_LIB |
#define | CO_RUN 0 |
#define | CO_SUS 1 |
#define | CO_NOR 2 |
#define | CO_DEAD 3 |
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 | costatus (lua_State *L, lua_State *co) |
static int | luaB_costatus (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_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 char *const | statnames [] |
static const luaL_Reg | co_funcs [] |
#define CO_DEAD 3 |
Definition at line 512 of file lbaselib.c.
Referenced by costatus().
#define CO_NOR 2 |
Definition at line 511 of file lbaselib.c.
Referenced by costatus().
#define CO_RUN 0 |
Definition at line 509 of file lbaselib.c.
Referenced by costatus().
#define CO_SUS 1 |
Definition at line 510 of file lbaselib.c.
Referenced by auxresume(), and costatus().
#define lbaselib_c |
Definition at line 14 of file lbaselib.c.
#define LUA_LIB |
Definition at line 15 of file lbaselib.c.
static void auxopen | ( | lua_State * | L, | |
const char * | name, | |||
lua_CFunction | f, | |||
lua_CFunction | u | |||
) | [static] |
Definition at line 645 of file lbaselib.c.
References lua_pushcclosure(), lua_pushcfunction, and lua_setfield().
Referenced by base_open().
Definition at line 545 of file lbaselib.c.
References CO_SUS, costatus(), lua_checkstack(), lua_gettop(), lua_pushfstring(), lua_resume(), lua_setlevel(), lua_xmove(), LUA_YIELD, luaL_error(), and statnames.
Referenced by luaB_auxwrap(), and luaB_coresume().
static void base_open | ( | lua_State * | L | ) | [static] |
Definition at line 653 of file lbaselib.c.
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().
Definition at line 517 of file lbaselib.c.
References CO_DEAD, CO_NOR, CO_RUN, CO_SUS, lua_getstack(), lua_gettop(), lua_status(), and LUA_YIELD.
Referenced by auxresume(), and luaB_costatus().
static const char* generic_reader | ( | lua_State * | L, | |
void * | ud, | |||
size_t * | size | |||
) | [static] |
Definition at line 324 of file lbaselib.c.
References lua_call(), lua_isnil, lua_isstring(), lua_pushvalue(), lua_replace(), lua_tolstring(), luaL_checkstack(), and luaL_error().
Referenced by luaB_load().
static void getfunc | ( | lua_State * | L, | |
int | opt | |||
) | [static] |
Definition at line 144 of file lbaselib.c.
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 274 of file lbaselib.c.
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 293 of file lbaselib.c.
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 361 of file lbaselib.c.
References lua_gettop(), lua_toboolean(), luaL_checkany(), luaL_error(), and luaL_optstring.
static int luaB_auxwrap | ( | lua_State * | L | ) | [static] |
Definition at line 588 of file lbaselib.c.
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 603 of file lbaselib.c.
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 220 of file lbaselib.c.
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(), and luaL_optint.
static int luaB_coresume | ( | lua_State * | L | ) | [static] |
Definition at line 570 of file lbaselib.c.
References auxresume(), lua_gettop(), lua_insert(), lua_pushboolean(), lua_tothread(), and luaL_argcheck.
static int luaB_corunning | ( | lua_State * | L | ) | [static] |
Definition at line 625 of file lbaselib.c.
References lua_pushnil(), and lua_pushthread().
static int luaB_costatus | ( | lua_State * | L | ) | [static] |
Definition at line 537 of file lbaselib.c.
References costatus(), lua_pushstring(), lua_tothread(), luaL_argcheck, and statnames.
static int luaB_cowrap | ( | lua_State * | L | ) | [static] |
Definition at line 613 of file lbaselib.c.
References lua_pushcclosure(), luaB_auxwrap(), and luaB_cocreate().
static int luaB_dofile | ( | lua_State * | L | ) | [static] |
Definition at line 352 of file lbaselib.c.
References lua_call(), lua_error(), lua_gettop(), LUA_MULTRET, luaL_loadfile(), and luaL_optstring.
static int luaB_error | ( | lua_State * | L | ) | [static] |
Definition at line 108 of file lbaselib.c.
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 214 of file lbaselib.c.
References lua_getgccount, and lua_pushinteger().
static int luaB_getfenv | ( | lua_State * | L | ) | [static] |
Definition at line 160 of file lbaselib.c.
References getfunc(), lua_getfenv(), LUA_GLOBALSINDEX, lua_iscfunction(), and lua_pushvalue().
static int luaB_getmetatable | ( | lua_State * | L | ) | [static] |
Definition at line 120 of file lbaselib.c.
References lua_getmetatable(), lua_pushnil(), luaL_checkany(), and luaL_getmetafield().
static int luaB_ipairs | ( | lua_State * | L | ) | [static] |
Definition at line 284 of file lbaselib.c.
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 342 of file lbaselib.c.
References generic_reader(), load_aux(), lua_load(), lua_settop(), LUA_TFUNCTION, luaL_checktype(), and luaL_optstring.
static int luaB_loadfile | ( | lua_State * | L | ) | [static] |
Definition at line 312 of file lbaselib.c.
References load_aux(), luaL_loadfile(), and luaL_optstring.
static int luaB_loadstring | ( | lua_State * | L | ) | [static] |
Definition at line 304 of file lbaselib.c.
References load_aux(), luaL_checklstring(), luaL_loadbuffer(), and luaL_optstring.
static int luaB_newproxy | ( | lua_State * | L | ) | [static] |
Definition at line 448 of file lbaselib.c.
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 253 of file lbaselib.c.
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 265 of file lbaselib.c.
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 401 of file lbaselib.c.
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 57 of file lbaselib.c.
References lua_call(), lua_getglobal, lua_gettop(), lua_pop, lua_pushvalue(), LUA_QL, lua_tostring, and luaL_error().
static int luaB_rawequal | ( | lua_State * | L | ) | [static] |
Definition at line 188 of file lbaselib.c.
References lua_pushboolean(), lua_rawequal(), and luaL_checkany().
static int luaB_rawget | ( | lua_State * | L | ) | [static] |
Definition at line 196 of file lbaselib.c.
References lua_rawget(), lua_settop(), LUA_TTABLE, luaL_checkany(), and luaL_checktype().
static int luaB_rawset | ( | lua_State * | L | ) | [static] |
Definition at line 204 of file lbaselib.c.
References lua_rawset(), lua_settop(), LUA_TTABLE, luaL_checkany(), and luaL_checktype().
static int luaB_select | ( | lua_State * | L | ) | [static] |
Definition at line 385 of file lbaselib.c.
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 170 of file lbaselib.c.
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 131 of file lbaselib.c.
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 80 of file lbaselib.c.
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 423 of file lbaselib.c.
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 246 of file lbaselib.c.
References lua_pushstring(), luaL_checkany(), and luaL_typename.
static int luaB_unpack | ( | lua_State * | L | ) | [static] |
Definition at line 369 of file lbaselib.c.
References lua_checkstack(), lua_rawgeti(), LUA_TTABLE, luaL_checkint, luaL_checktype(), luaL_error(), luaL_getn, luaL_opt, and luaL_optint.
static int luaB_xpcall | ( | lua_State * | L | ) | [static] |
Definition at line 411 of file lbaselib.c.
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 620 of file lbaselib.c.
References lua_gettop(), and lua_yield().
LUALIB_API int luaopen_base | ( | lua_State * | L | ) |
Definition at line 675 of file lbaselib.c.
References base_open(), LUA_COLIBNAME, and luaL_register().
const luaL_Reg base_funcs[] [static] |
{ {"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}, {"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 474 of file lbaselib.c.
{ {"create", luaB_cocreate}, {"resume", luaB_coresume}, {"running", luaB_corunning}, {"status", luaB_costatus}, {"wrap", luaB_cowrap}, {"yield", luaB_yield}, {NULL, NULL} }
Definition at line 632 of file lbaselib.c.
const char* const statnames[] [static] |
{"running", "suspended", "normal", "dead"}
Definition at line 514 of file lbaselib.c.
Referenced by auxresume(), and luaB_costatus().
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:59 2011 by Doxygen 1.6.1