summaryrefslogtreecommitdiffstats
path: root/Sluift
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2013-12-26 12:33:02 (GMT)
committerRemko Tronçon <git@el-tramo.be>2013-12-27 23:06:38 (GMT)
commitf85b4104a1039165dbe1697174151d01c519b95a (patch)
tree21bee867ae3c29688f19ce71cca683dc5dfaf23c /Sluift
parent74117f069f2339bace7c5b97bb79c6cc9a57bbc7 (diff)
downloadswift-f85b4104a1039165dbe1697174151d01c519b95a.zip
swift-f85b4104a1039165dbe1697174151d01c519b95a.tar.bz2
Sluift: Import sluift into global namespace
Change-Id: I783ab0dc7bf46cc02ed4244a5078f6ec040fefb7
Diffstat (limited to 'Sluift')
-rw-r--r--Sluift/linit.c9
1 files changed, 9 insertions, 0 deletions
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);
+ }
}