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
14 static const luaL_Reg lualibs
[] = {
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
},
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
);