00001 /* 00002 ** $Id: linit.c,v 1.14.1.1 2007/12/27 13:02:25 roberto Exp $ 00003 ** Initialization of libraries for lua.c 00004 ** See Copyright Notice in lua.h 00005 */ 00006 00007 00008 #define linit_c 00009 #define LUA_LIB 00010 00011 #include "lua.h" 00012 00013 #include "lualib.h" 00014 #include "lauxlib.h" 00015 00016 static const luaL_Reg lualibs[] = { 00017 {"", luaopen_base}, 00018 {LUA_LOADLIBNAME, luaopen_package}, 00019 {LUA_TABLIBNAME, luaopen_table}, 00020 {LUA_IOLIBNAME, luaopen_io}, 00021 {LUA_OSLIBNAME, luaopen_os}, 00022 {LUA_STRLIBNAME, luaopen_string}, 00023 {LUA_MATHLIBNAME, luaopen_math}, 00024 {LUA_DBLIBNAME, luaopen_debug}, 00025 {NULL, NULL} 00026 }; 00027 00028 00029 LUALIB_API void luaL_openlibs (lua_State *L) { 00030 const luaL_Reg *lib = lualibs; 00031 for (; lib->func; lib++) { 00032 lua_pushcfunction(L, lib->func); 00033 lua_pushstring(L, lib->name); 00034 lua_call(L, 1, 0); 00035 } 00036 } 00037
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:54 2011 by Doxygen 1.6.1