diff options
| author | Lua Team <team@lua.org> | 2004-12-30 12:00:00 +0000 |
|---|---|---|
| committer | repogen <> | 2004-12-30 12:00:00 +0000 |
| commit | e2493a40ee611d5a718fd2a81fe67e24c04c91a0 (patch) | |
| tree | 0dca96133b3cd52d262dfa2592ad076fc0ea7852 /src/linit.c | |
| parent | 226f7859b5392b6680b7e703f9cc7f7f101fd365 (diff) | |
| download | lua-github-5.1-work4.tar.gz | |
Lua 5.1-work45.1-work4
Diffstat (limited to 'src/linit.c')
| -rw-r--r-- | src/linit.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/linit.c b/src/linit.c new file mode 100644 index 00000000..0d5f9cd4 --- /dev/null +++ b/src/linit.c @@ -0,0 +1,38 @@ +/* +** $Id: linit.c,v 1.8 2004/07/09 15:47:48 roberto Exp $ +** Initialization of libraries for lua.c +** See Copyright Notice in lua.h +*/ + + +#define linit_c +#define LUA_LIB + +#include "lua.h" + +#include "lualib.h" +#include "lauxlib.h" + + +static const luaL_reg lualibs[] = { + {"", luaopen_base}, + {LUA_TABLIBNAME, luaopen_table}, + {LUA_IOLIBNAME, luaopen_io}, + {LUA_OSLIBNAME, luaopen_os}, + {LUA_STRLIBNAME, luaopen_string}, + {LUA_MATHLIBNAME, luaopen_math}, + {LUA_DBLIBNAME, luaopen_debug}, + {"", luaopen_loadlib}, + {NULL, NULL} +}; + + +LUALIB_API int luaopen_stdlibs (lua_State *L) { + const luaL_reg *lib = lualibs; + for (; lib->func; lib++) { + lib->func(L); /* open library */ + lua_settop(L, 0); /* discard any results */ + } + return 0; +} + |
