diff options
author | Eugene Sandulenko | 2010-10-18 17:12:00 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-18 17:12:00 +0000 |
commit | 3feac393b0c951c53d96181b320dd42f5c725f35 (patch) | |
tree | 9fdf2fa312777288a76356c21e2d2098fd752d0f /engines/sword25/util/lua/linit.cpp | |
parent | 3b21db16188899eac9914fe1c3b32b311a3aa344 (diff) | |
download | scummvm-rg350-3feac393b0c951c53d96181b320dd42f5c725f35.tar.gz scummvm-rg350-3feac393b0c951c53d96181b320dd42f5c725f35.tar.bz2 scummvm-rg350-3feac393b0c951c53d96181b320dd42f5c725f35.zip |
SWORD25: Renamed Lua .c files to .cpp and make it compilable
svn-id: r53568
Diffstat (limited to 'engines/sword25/util/lua/linit.cpp')
-rw-r--r-- | engines/sword25/util/lua/linit.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/engines/sword25/util/lua/linit.cpp b/engines/sword25/util/lua/linit.cpp new file mode 100644 index 0000000000..93f41d0350 --- /dev/null +++ b/engines/sword25/util/lua/linit.cpp @@ -0,0 +1,38 @@ +/* +** $Id$ +** Initialization of libraries for lua.c +** See Copyright Notice in lua.h +*/ + + +#define linit_c +#define LUA_LIB + +#include "lua.h" + +#include "lualib.h" +#include "lauxlib.h" + + +static const luaL_Reg lualibs[] = { + {"", luaopen_base}, + {LUA_LOADLIBNAME, luaopen_package}, + {LUA_TABLIBNAME, luaopen_table}, + {LUA_IOLIBNAME, luaopen_io}, + {LUA_OSLIBNAME, luaopen_os}, + {LUA_STRLIBNAME, luaopen_string}, + {LUA_MATHLIBNAME, luaopen_math}, + {LUA_DBLIBNAME, luaopen_debug}, + {NULL, NULL} +}; + + +LUALIB_API void luaL_openlibs (lua_State *L) { + const luaL_Reg *lib = lualibs; + for (; lib->func; lib++) { + lua_pushcfunction(L, lib->func); + lua_pushstring(L, lib->name); + lua_call(L, 1, 0); + } +} + |