rlm@1: /* rlm@1: ** $Id: linit.c,v 1.14.1.1 2007/12/27 13:02:25 roberto Exp $ rlm@1: ** Initialization of libraries for lua.c rlm@1: ** See Copyright Notice in lua.h rlm@1: */ rlm@1: rlm@1: rlm@1: #define linit_c rlm@1: #define LUA_LIB rlm@1: rlm@1: #include "lua.h" rlm@1: rlm@1: #include "lualib.h" rlm@1: #include "lauxlib.h" rlm@1: rlm@1: rlm@1: static const luaL_Reg lualibs[] = { rlm@1: {"", luaopen_base}, rlm@1: {LUA_LOADLIBNAME, luaopen_package}, rlm@1: {LUA_TABLIBNAME, luaopen_table}, rlm@1: {LUA_IOLIBNAME, luaopen_io}, rlm@1: {LUA_OSLIBNAME, luaopen_os}, rlm@1: {LUA_STRLIBNAME, luaopen_string}, rlm@1: {LUA_MATHLIBNAME, luaopen_math}, rlm@1: {LUA_DBLIBNAME, luaopen_debug}, rlm@1: {NULL, NULL} rlm@1: }; rlm@1: rlm@1: rlm@1: LUALIB_API void luaL_openlibs (lua_State *L) { rlm@1: const luaL_Reg *lib = lualibs; rlm@1: for (; lib->func; lib++) { rlm@1: lua_pushcfunction(L, lib->func); rlm@1: lua_pushstring(L, lib->name); rlm@1: lua_call(L, 1, 0); rlm@1: } rlm@1: } rlm@1: