lbaselib.c File Reference

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 Documentation

#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.


Function Documentation

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().

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

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]
static void getfunc ( lua_State L,
int  opt 
) [static]
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]
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]
static int luaB_coresume ( lua_State L  )  [static]
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]
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]
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]
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]
static int luaB_print ( lua_State L  )  [static]
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]
static int luaB_setfenv ( 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]
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]
static int luaB_xpcall ( lua_State L  )  [static]
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().


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},
  {"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.

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 632 of file lbaselib.c.

const char* const statnames[] [static]
Initial value:
    {"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