From 9aaffab5721e0b2e850d6ffe9cf6c1e1367fc8ca Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 25 Oct 2018 10:38:31 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9=E7=9B=AE=E5=BD=95=E7=BB=93=E6=9E=84?= =?UTF-8?q?=EF=BC=8C=E5=B0=86lua=20binding=E7=8B=AC=E7=AB=8B=E5=87=BA?= =?UTF-8?q?=E6=9D=A5=E4=B8=80=E4=B8=AA=E5=B7=A5=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/main.cpp | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 src/lua/main.cpp (limited to 'src/lua/main.cpp') diff --git a/src/lua/main.cpp b/src/lua/main.cpp deleted file mode 100644 index 95862ec..0000000 --- a/src/lua/main.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#ifdef _WIN32 - #include - #include -#endif - -#include "luax.h" -#include "jin.h" -#include "libjin/jin.h" -#include - -using namespace JinEngine::Lua; -using namespace JinEngine::Filesystem; - -int main(int argc, char* argv[]) -{ - lua_State* L = luax_newstate(); - - /* open lua standard module */ - luax_openlibs(L); - /* open jin module */ - luaopen_jin(L); - /* add args to field */ - luax_newtable(L); - for (int i = 0; i < argc; ++i) - luax_setrawstring(L, -2, i + 1, argv[i]); - luax_setfield(L, -2, "args"); - /* push current working directory */ - /* absolute directory */ - Buffer cwd = Buffer(1024); -#ifdef _WIN32 - _getcwd((char*)&cwd, cwd.size()); -#elif defined __unix__ -#elif defined __APPLE__ -#endif - luax_setfieldstring(L, "cwd", (char*)&cwd); - luax_clear(L); - - /* boot jin and run it */ - boot(L); - - luax_close(L); - - return 0; -} \ No newline at end of file -- cgit v1.1-26-g67d0