Minor fixes for x64 interpreter.
[luajit-2.0/celess22.git] / src / lib_init.c
blob04ca60d988ae248cfdf8d6af4b7f51177ca4cdf4
1 /*
2 ** Library initialization.
3 ** Major parts taken verbatim from the Lua interpreter.
4 ** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h
5 */
7 #define lib_init_c
8 #define LUA_LIB
10 #include "lua.h"
11 #include "lauxlib.h"
12 #include "lualib.h"
14 static const luaL_Reg lualibs[] = {
15 { "", luaopen_base },
16 { LUA_LOADLIBNAME, luaopen_package },
17 { LUA_TABLIBNAME, luaopen_table },
18 { LUA_IOLIBNAME, luaopen_io },
19 { LUA_OSLIBNAME, luaopen_os },
20 { LUA_STRLIBNAME, luaopen_string },
21 { LUA_MATHLIBNAME, luaopen_math },
22 { LUA_DBLIBNAME, luaopen_debug },
23 { LUA_BITLIBNAME, luaopen_bit },
24 { LUA_JITLIBNAME, luaopen_jit },
25 { NULL, NULL }
28 LUALIB_API void luaL_openlibs(lua_State *L)
30 const luaL_Reg *lib = lualibs;
31 for (; lib->func; lib++) {
32 lua_pushcfunction(L, lib->func);
33 lua_pushstring(L, lib->name);
34 lua_call(L, 1, 0);