aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-09-10 07:17:50 +0800
committerchai <chaifix@163.com>2018-09-10 07:17:50 +0800
commit8339939b7fce5236b1a933eef46e1dd4284a24aa (patch)
treef62c1cefb54e1e8b14fb91564b13d436accff1da /src/main.cpp
parent6decddfd8470b44609e8c3aa144380f198b7b54c (diff)
*update
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/main.cpp b/src/main.cpp
deleted file mode 100644
index 18d873d..0000000
--- a/src/main.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifdef _WIN32
-#include <SDL2/SDL_Main.h>
-#include <direct.h>
-#endif
-
-#include "luax.h"
-#include "lua/modules/jin.h"
-#include "libjin/jin.h"
-#include <Windows.h>
-
-using namespace jin::lua;
-using namespace jin::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.data, cwd.size);
-#elif defined __unix__
-#elif defined __APPLE__
-#endif
- luax_setfieldstring(L, "cwd", (char*)cwd.data);
- luax_clear(L);
-
- /* boot jin and run it */
- boot(L);
-
- luax_close(L);
- return 0;
-} \ No newline at end of file