#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 | 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 AUXMARK "\1" |
| #define DLMSG "dynamic libraries not enabled; check your Lua installation" |
| #define ERRFUNC 2 |
| #define ERRLIB 1 |
| #define LIB_FAIL "absent" |
Definition at line 233 of file loadlib.cpp.
| #define LIB_FAIL "open" |
| #define LIBPREFIX "LOADLIB: " |
| #define loadlib_c |
Definition at line 16 of file loadlib.cpp.
| #define LUA_LIB |
Definition at line 17 of file loadlib.cpp.
| #define LUA_OFSEP "_" |
| #define LUA_POF "luaopen_" |
Definition at line 26 of file loadlib.cpp.
| #define POF LUA_POF |
| #define sentinel ((void *)&sentinel_) |
| #define setprogdir | ( | L | ) | ((void)0) |
| static void dooptions | ( | lua_State * | L, | |
| int | n | |||
| ) | [static] |
Definition at line 517 of file loadlib.cpp.
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 351 of file loadlib.cpp.
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(), NULL, pushnexttemplate(), and readable().
Referenced by loader_C(), loader_Croot(), and loader_Lua().
| static int gctm | ( | lua_State * | L | ) | [static] |
Definition at line 286 of file loadlib.cpp.
References ll_unloadlib(), luaL_checkudata(), and NULL.
Referenced by luaopen_package().
| static void * ll_load | ( | lua_State * | L, | |
| const char * | path | |||
| ) | [static] |
Definition at line 244 of file loadlib.cpp.
References DLMSG, lua_pushliteral, and NULL.
Referenced by ll_loadfunc().
| static int ll_loadfunc | ( | lua_State * | L, | |
| const char * | path, | |||
| const char * | sym | |||
| ) | [static] |
Definition at line 294 of file loadlib.cpp.
References ERRFUNC, ERRLIB, ll_load(), ll_register(), ll_sym(), lua_pushcfunction, and NULL.
Referenced by ll_loadlib(), loader_C(), and loader_Croot().
| static int ll_loadlib | ( | lua_State * | L | ) | [static] |
Definition at line 309 of file loadlib.cpp.
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 542 of file loadlib.cpp.
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(), NULL, and setfenv().
| static void** ll_register | ( | lua_State * | L, | |
| const char * | path | |||
| ) | [static] |
Definition at line 262 of file loadlib.cpp.
References LIBPREFIX, lua_gettable(), lua_isnil, lua_newuserdata(), lua_pop, lua_pushfstring(), lua_pushvalue(), LUA_REGISTRYINDEX, lua_setmetatable(), lua_settable(), lua_touserdata(), luaL_getmetatable, and NULL.
Referenced by ll_loadfunc().
| static int ll_require | ( | lua_State * | L | ) | [static] |
Definition at line 451 of file loadlib.cpp.
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 570 of file loadlib.cpp.
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 251 of file loadlib.cpp.
References DLMSG, lua_pushliteral, and NULL.
Referenced by ll_loadfunc().
| static void ll_unloadlib | ( | void * | lib | ) | [static] |
| static int loader_C | ( | lua_State * | L | ) | [static] |
Definition at line 402 of file loadlib.cpp.
References findfile(), funcname(), ll_loadfunc(), loaderror(), luaL_checkstring, mkfuncname(), and NULL.
| static int loader_Croot | ( | lua_State * | L | ) | [static] |
Definition at line 414 of file loadlib.cpp.
References ERRFUNC, findfile(), funcname(), ll_loadfunc(), loaderror(), lua_pushfstring(), lua_pushlstring(), LUA_QS, lua_tostring, luaL_checkstring, mkfuncname(), and NULL.
| static int loader_Lua | ( | lua_State * | L | ) | [static] |
Definition at line 380 of file loadlib.cpp.
References findfile(), loaderror(), luaL_checkstring, luaL_loadfile(), and NULL.
| static int loader_preload | ( | lua_State * | L | ) | [static] |
Definition at line 435 of file loadlib.cpp.
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 374 of file loadlib.cpp.
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 625 of file loadlib.cpp.
| static const char* mkfuncname | ( | lua_State * | L, | |
| const char * | modname | |||
| ) | [static] |
Definition at line 391 of file loadlib.cpp.
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 527 of file loadlib.cpp.
References lua_pushlstring(), lua_pushstring(), lua_pushvalue(), lua_setfield(), and NULL.
Referenced by ll_module().
| static const char* pushnexttemplate | ( | lua_State * | L, | |
| const char * | path | |||
| ) | [static] |
Definition at line 340 of file loadlib.cpp.
References LUA_PATHSEP, lua_pushlstring(), NULL, and LangStringUtil::strlen().
Referenced by findfile().
| static int readable | ( | const char * | filename | ) | [static] |
| static void setfenv | ( | lua_State * | L | ) | [static] |
Definition at line 507 of file loadlib.cpp.
References lua_getinfo(), lua_getstack(), lua_pop, lua_pushvalue(), and lua_setfenv().
Referenced by ll_module().
| static void setpath | ( | lua_State * | L, | |
| const char * | fieldname, | |||
| const char * | envname, | |||
| const char * | def | |||
| ) | [static] |
Definition at line 590 of file loadlib.cpp.
References AUXMARK, LUA_PATHSEP, lua_pushstring(), lua_remove(), lua_setfield(), luaL_gsub(), NULL, and setprogdir.
Referenced by luaopen_package().
Initial value:
{
{"module", ll_module},
{"require", ll_require},
{NULL, NULL}
}
Definition at line 614 of file loadlib.cpp.
const lua_CFunction loaders[] [static] |
Initial value:
Definition at line 621 of file loadlib.cpp.
Initial value:
{
{"loadlib", ll_loadlib},
{"seeall", ll_seeall},
{NULL, NULL}
}
Definition at line 607 of file loadlib.cpp.
const int sentinel_ = 0 [static] |
Definition at line 447 of file loadlib.cpp.
1.5.3