1 /* $NetBSD: linit.c,v 1.1.1.2 2012/03/15 00:08:04 alnsn Exp $ */
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
19 static const luaL_Reg lualibs
[] = {
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
},
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
);