From f85b4104a1039165dbe1697174151d01c519b95a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be> Date: Thu, 26 Dec 2013 13:33:02 +0100 Subject: Sluift: Import sluift into global namespace Change-Id: I783ab0dc7bf46cc02ed4244a5078f6ec040fefb7 diff --git a/Sluift/linit.c b/Sluift/linit.c index 8507609..8f0614b 100644 --- a/Sluift/linit.c +++ b/Sluift/linit.c @@ -24,4 +24,13 @@ LUALIB_API void luaL_openlibs (lua_State *L) { lua_pushstring(L, lib->name); lua_call(L, 1, 0); } + + /* Import sluift into global namespace */ + lua_getfield(L, LUA_GLOBALSINDEX, "sluift"); + for (lua_pushnil(L); lua_next(L, -2); ) { + lua_pushvalue(L, -2); + lua_pushvalue(L, -2); + lua_settable(L, LUA_GLOBALSINDEX); + lua_pop(L, 1); + } } -- cgit v0.10.2-6-g49f6