Go to the source code of this file.
Defines | |
| #define | loadlib_c |
| #define | LUA_LIB |
| #define | LUA_POF "luaopen_" |
| #define | LUA_OFSEP "_" |
| #define | LIBPREFIX "LOADLIB: " |
| #define | POF LUA_POF |
| #define | LIB_FAIL "open" |
| #define | ERRLIB 1 |
| #define | ERRFUNC 2 |
| #define | setprogdir(L) ((void)0) |
| #define | LIB_FAIL "absent" |
| #define | DLMSG "dynamic libraries not enabled; check your Lua installation" |
| #define | sentinel ((void *)&sentinel_) |
| #define | AUXMARK "\1" |
Functions | |
| static void | ll_unloadlib (void *lib) |
| static void * | ll_load (lua_State *L, const char *path) |
| static lua_CFunction | ll_sym (lua_State *L, void *lib, const char *sym) |
| static void ** | ll_register (lua_State *L, const char *path) |
| static int | gctm (lua_State *L) |
| static int | ll_loadfunc (lua_State *L, const char *path, const char *sym) |
| static int | ll_loadlib (lua_State *L) |
| static int | readable (const char *filename) |
| static const char * | pushnexttemplate (lua_State *L, const char *path) |
| static const char * | findfile (lua_State *L, const char *name, const char *pname) |
| static void | loaderror (lua_State *L, const char *filename) |
| static int | loader_Lua (lua_State *L) |
| static const char * | mkfuncname (lua_State *L, const char *modname) |
| static int | loader_C (lua_State *L) |
| static int | loader_Croot (lua_State *L) |
| static int | loader_preload (lua_State *L) |
| static int | ll_require (lua_State *L) |
| static void | setfenv (lua_State *L) |
| static void | dooptions (lua_State *L, int n) |
| static void | modinit (lua_State *L, const char *modname) |
| static int | ll_module (lua_State *L) |
| static int | ll_seeall (lua_State *L) |
| static void | setpath (lua_State *L, const char *fieldname, const char *envname, const char *def) |
| LUALIB_API int | luaopen_package (lua_State *L) |
Variables | |
| static const int | sentinel_ = 0 |
| static const luaL_Reg | pk_funcs [] |
| static const luaL_Reg | ll_funcs [] |
| static const lua_CFunction | loaders [] |
| #define DLMSG "dynamic libraries not enabled; check your Lua installation" |
| #define ERRFUNC 2 |
Definition at line 40 of file loadlib.c.
Referenced by ll_loadfunc(), and loader_Croot().
| #define ERRLIB 1 |
Definition at line 39 of file loadlib.c.
Referenced by ll_loadfunc(), and ll_loadlib().
| #define LIB_FAIL "open" |
Definition at line 270 of file loadlib.c.
Referenced by ll_loadlib().
| #define LIBPREFIX "LOADLIB: " |
Definition at line 32 of file loadlib.c.
Referenced by ll_register().
| #define LUA_OFSEP "_" |
Definition at line 29 of file loadlib.c.
Referenced by mkfuncname().
| #define POF LUA_POF |
Definition at line 34 of file loadlib.c.
Referenced by mkfuncname().
| #define sentinel ((void *)&sentinel_) |
Definition at line 485 of file loadlib.c.
Referenced by ll_require().
| #define setprogdir | ( | L | ) | ((void)0) |
| static void dooptions | ( | lua_State * | L, | |
| int | n | |||
| ) | [static] |
Definition at line 556 of file loadlib.c.
References lua_call(), and lua_pushvalue().
Referenced by ll_module().
| static const char* findfile | ( | lua_State * | L, | |
| const char * | name, | |||
| const char * | pname | |||
| ) | [static] |
Definition at line 388 of file loadlib.c.
References lua_concat(), LUA_DIRSEP, LUA_ENVIRONINDEX, lua_getfield(), LUA_PATH_MARK, lua_pushfstring(), lua_pushliteral, LUA_QL, LUA_QS, lua_remove(), lua_tostring, luaL_error(), luaL_gsub(), pushnexttemplate(), and readable().
Referenced by loader_C(), loader_Croot(), and loader_Lua().
| static int gctm | ( | lua_State * | L | ) | [static] |
Definition at line 323 of file loadlib.c.
References ll_unloadlib(), and luaL_checkudata().
Referenced by luaopen_package().
| static void * ll_load | ( | lua_State * | L, | |
| const char * | path | |||
| ) | [static] |
Definition at line 281 of file loadlib.c.
References DLMSG, and lua_pushliteral.
Referenced by ll_loadfunc().
| static int ll_loadfunc | ( | lua_State * | L, | |
| const char * | path, | |||
| const char * | sym | |||
| ) | [static] |
Definition at line 331 of file loadlib.c.
References ERRFUNC, ERRLIB, ll_load(), ll_register(), ll_sym(), and lua_pushcfunction.
Referenced by ll_loadlib(), loader_C(), and loader_Croot().
| static int ll_loadlib | ( | lua_State * | L | ) | [static] |
Definition at line 346 of file loadlib.c.
References ERRLIB, LIB_FAIL, ll_loadfunc(), lua_insert(), lua_pushnil(), lua_pushstring(), and luaL_checkstring.
| static int ll_module | ( | lua_State * | L | ) | [static] |
Definition at line 581 of file loadlib.c.
References dooptions(), lua_getfield(), lua_gettop(), LUA_GLOBALSINDEX, lua_isnil, lua_istable, lua_pop, lua_pushvalue(), LUA_QS, LUA_REGISTRYINDEX, lua_setfield(), luaL_checkstring, luaL_error(), luaL_findtable(), modinit(), and setfenv().
| static void** ll_register | ( | lua_State * | L, | |
| const char * | path | |||
| ) | [static] |
Definition at line 299 of file loadlib.c.
References LIBPREFIX, lua_gettable(), lua_isnil, lua_newuserdata(), lua_pop, lua_pushfstring(), lua_pushvalue(), LUA_REGISTRYINDEX, lua_setmetatable(), lua_settable(), lua_touserdata(), and luaL_getmetatable.
Referenced by ll_loadfunc().
| static int ll_require | ( | lua_State * | L | ) | [static] |
Definition at line 488 of file loadlib.c.
References lua_call(), lua_concat(), LUA_ENVIRONINDEX, lua_getfield(), lua_isfunction, lua_isnil, lua_isstring(), lua_istable, lua_pop, lua_pushboolean(), lua_pushlightuserdata(), lua_pushliteral, lua_pushstring(), lua_pushvalue(), LUA_QL, LUA_QS, lua_rawgeti(), LUA_REGISTRYINDEX, lua_setfield(), lua_settop(), lua_toboolean(), lua_tostring, lua_touserdata(), luaL_checkstring, luaL_error(), and sentinel.
| static int ll_seeall | ( | lua_State * | L | ) | [static] |
Definition at line 609 of file loadlib.c.
References lua_createtable(), lua_getmetatable(), LUA_GLOBALSINDEX, lua_pushvalue(), lua_setfield(), lua_setmetatable(), LUA_TTABLE, and luaL_checktype().
| static lua_CFunction ll_sym | ( | lua_State * | L, | |
| void * | lib, | |||
| const char * | sym | |||
| ) | [static] |
Definition at line 288 of file loadlib.c.
References DLMSG, and lua_pushliteral.
Referenced by ll_loadfunc().
| static void ll_unloadlib | ( | void * | lib | ) | [static] |
| static int loader_C | ( | lua_State * | L | ) | [static] |
Definition at line 439 of file loadlib.c.
References findfile(), funcname(), ll_loadfunc(), loaderror(), luaL_checkstring, and mkfuncname().
| static int loader_Croot | ( | lua_State * | L | ) | [static] |
Definition at line 451 of file loadlib.c.
References ERRFUNC, findfile(), funcname(), ll_loadfunc(), loaderror(), lua_pushfstring(), lua_pushlstring(), LUA_QS, lua_tostring, luaL_checkstring, and mkfuncname().
| static int loader_Lua | ( | lua_State * | L | ) | [static] |
Definition at line 417 of file loadlib.c.
References findfile(), loaderror(), luaL_checkstring, and luaL_loadfile().
| static int loader_preload | ( | lua_State * | L | ) | [static] |
Definition at line 472 of file loadlib.c.
References LUA_ENVIRONINDEX, lua_getfield(), lua_isnil, lua_istable, lua_pushfstring(), LUA_QL, luaL_checkstring, and luaL_error().
| static void loaderror | ( | lua_State * | L, | |
| const char * | filename | |||
| ) | [static] |
Definition at line 411 of file loadlib.c.
References LUA_QS, lua_tostring, and luaL_error().
Referenced by loader_C(), loader_Croot(), and loader_Lua().
| LUALIB_API int luaopen_package | ( | lua_State * | L | ) |
Definition at line 664 of file loadlib.c.
References gctm(), LUA_CPATH, LUA_CPATH_DEFAULT, lua_createtable(), LUA_DIRSEP, LUA_ENVIRONINDEX, LUA_EXECDIR, lua_getfield(), LUA_GLOBALSINDEX, LUA_IGMARK, LUA_LOADLIBNAME, lua_newtable, LUA_PATH, LUA_PATH_DEFAULT, LUA_PATH_MARK, LUA_PATHSEP, lua_pop, lua_pushcfunction, lua_pushliteral, lua_pushvalue(), lua_rawseti(), LUA_REGISTRYINDEX, lua_replace(), lua_setfield(), luaL_findtable(), luaL_newmetatable(), luaL_register(), and setpath().
| static const char* mkfuncname | ( | lua_State * | L, | |
| const char * | modname | |||
| ) | [static] |
Definition at line 428 of file loadlib.c.
References funcname(), LUA_IGMARK, LUA_OFSEP, lua_pushfstring(), lua_remove(), luaL_gsub(), and POF.
Referenced by loader_C(), and loader_Croot().
| static void modinit | ( | lua_State * | L, | |
| const char * | modname | |||
| ) | [static] |
Definition at line 566 of file loadlib.c.
References lua_pushlstring(), lua_pushstring(), lua_pushvalue(), and lua_setfield().
Referenced by ll_module().
| static const char* pushnexttemplate | ( | lua_State * | L, | |
| const char * | path | |||
| ) | [static] |
Definition at line 377 of file loadlib.c.
References LUA_PATHSEP, and lua_pushlstring().
Referenced by findfile().
| static int readable | ( | const char * | filename | ) | [static] |
Definition at line 369 of file loadlib.c.
Referenced by findfile().
| static void setfenv | ( | lua_State * | L | ) | [static] |
Definition at line 544 of file loadlib.c.
References lua_getinfo(), lua_getstack(), lua_iscfunction(), lua_pop, lua_pushvalue(), LUA_QL, lua_setfenv(), and luaL_error().
Referenced by ll_module().
| static void setpath | ( | lua_State * | L, | |
| const char * | fieldname, | |||
| const char * | envname, | |||
| const char * | def | |||
| ) | [static] |
Definition at line 629 of file loadlib.c.
References AUXMARK, LUA_PATHSEP, lua_pushstring(), lua_remove(), lua_setfield(), luaL_gsub(), and setprogdir.
Referenced by luaopen_package().
{
{"module", ll_module},
{"require", ll_require},
{NULL, NULL}
}
const lua_CFunction loaders[] [static] |
{loader_preload, loader_Lua, loader_C, loader_Croot, NULL}
{
{"loadlib", ll_loadlib},
{"seeall", ll_seeall},
{NULL, NULL}
}
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:50:00 2011 by Doxygen 1.6.1