diff options
author | Kevin Smith <git@kismith.co.uk> | 2012-07-27 22:03:45 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2012-07-27 22:03:45 (GMT) |
commit | ca5c7b0a957e651b12083a43e700a19d54fd1016 (patch) | |
tree | c781f240380368950df5335aab32978cd7121b0e /Swiftob | |
parent | 6f26d9aa86f0909af13b23b1a925b8d492e74154 (diff) | |
download | swift-contrib-ca5c7b0a957e651b12083a43e700a19d54fd1016.zip swift-contrib-ca5c7b0a957e651b12083a43e700a19d54fd1016.tar.bz2 |
First bash at integrating luasocket into Sluift
Diffstat (limited to 'Swiftob')
-rw-r--r-- | Swiftob/LuaCommands.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Swiftob/LuaCommands.cpp b/Swiftob/LuaCommands.cpp index 27c44eb..bf43067 100644 --- a/Swiftob/LuaCommands.cpp +++ b/Swiftob/LuaCommands.cpp @@ -11,6 +11,11 @@ #include <algorithm> #include <iostream> +#ifdef LUA_HAVE_SOCKET +#include <3rdParty/Lua/luasocket/src/luasocket.h> +#include <3rdParty/Lua/luasocket/src/mime.h> +#endif + #include <Swiften/Base/foreach.h> #include <Swiften/Client/Client.h> #include <Swiften/Network/TimerFactory.h> @@ -403,6 +408,12 @@ void LuaCommands::loadScript(boost::filesystem::path filePath) { std::cout << "Trying to load file from " << filePath << std::endl; lua_State* lua = lua_open(); luaL_openlibs(lua); + +#ifdef LUA_HAVE_SOCKET + luaopen_socket_core(lua); + luaopen_mime_core(lua); +#endif + lua_pushlightuserdata(lua, this); lua_setfield(lua, LUA_REGISTRYINDEX, LUA_COMMANDS); std::string filename(filePath.filename()); |