release.sh changes & fixes
[minix3.git] / external / mit / lua / dist / src / linit.c
blobe80ebd8528d46e582a208ac21b2b9928f4eb93ae
1 /* $NetBSD: linit.c,v 1.1.1.2 2012/03/15 00:08:04 alnsn Exp $ */
3 /*
4 ** $Id: linit.c,v 1.1.1.2 2012/03/15 00:08:04 alnsn Exp $
5 ** Initialization of libraries for lua.c
6 ** See Copyright Notice in lua.h
7 */
10 #define linit_c
11 #define LUA_LIB
13 #include "lua.h"
15 #include "lualib.h"
16 #include "lauxlib.h"
19 static const luaL_Reg lualibs[] = {
20 {"", luaopen_base},
21 {LUA_LOADLIBNAME, luaopen_package},
22 {LUA_TABLIBNAME, luaopen_table},
23 {LUA_IOLIBNAME, luaopen_io},
24 {LUA_OSLIBNAME, luaopen_os},
25 {LUA_STRLIBNAME, luaopen_string},
26 {LUA_MATHLIBNAME, luaopen_math},
27 {LUA_DBLIBNAME, luaopen_debug},
28 {NULL, NULL}
32 LUALIB_API void luaL_openlibs (lua_State *L) {
33 const luaL_Reg *lib = lualibs;
34 for (; lib->func; lib++) {
35 lua_pushcfunction(L, lib->func);
36 lua_pushstring(L, lib->name);
37 lua_call(L, 1, 0);