diff src/lua/linit.c @ 11:27763b933818

raise lua sources up one level
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 11:07:39 -0600
parents src/lua/src/linit.c@f9f4f1b99eed
children
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/lua/linit.c	Sat Mar 03 11:07:39 2012 -0600
     1.3 @@ -0,0 +1,38 @@
     1.4 +/*
     1.5 +** $Id: linit.c,v 1.14.1.1 2007/12/27 13:02:25 roberto Exp $
     1.6 +** Initialization of libraries for lua.c
     1.7 +** See Copyright Notice in lua.h
     1.8 +*/
     1.9 +
    1.10 +
    1.11 +#define linit_c
    1.12 +#define LUA_LIB
    1.13 +
    1.14 +#include "lua.h"
    1.15 +
    1.16 +#include "lualib.h"
    1.17 +#include "lauxlib.h"
    1.18 +
    1.19 +
    1.20 +static const luaL_Reg lualibs[] = {
    1.21 +  {"", luaopen_base},
    1.22 +  {LUA_LOADLIBNAME, luaopen_package},
    1.23 +  {LUA_TABLIBNAME, luaopen_table},
    1.24 +  {LUA_IOLIBNAME, luaopen_io},
    1.25 +  {LUA_OSLIBNAME, luaopen_os},
    1.26 +  {LUA_STRLIBNAME, luaopen_string},
    1.27 +  {LUA_MATHLIBNAME, luaopen_math},
    1.28 +  {LUA_DBLIBNAME, luaopen_debug},
    1.29 +  {NULL, NULL}
    1.30 +};
    1.31 +
    1.32 +
    1.33 +LUALIB_API void luaL_openlibs (lua_State *L) {
    1.34 +  const luaL_Reg *lib = lualibs;
    1.35 +  for (; lib->func; lib++) {
    1.36 +    lua_pushcfunction(L, lib->func);
    1.37 +    lua_pushstring(L, lib->name);
    1.38 +    lua_call(L, 1, 0);
    1.39 +  }
    1.40 +}
    1.41 +