aboutsummaryrefslogtreecommitdiff
path: root/src/lua/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/common')
-rw-r--r--src/lua/common/common.h8
-rw-r--r--src/lua/common/error.h28
-rw-r--r--src/lua/common/je_lua_common.h9
-rw-r--r--src/lua/common/je_lua_constant.h (renamed from src/lua/common/constant.h)0
-rw-r--r--src/lua/common/je_lua_error.h27
-rw-r--r--src/lua/common/je_lua_port.h8
-rw-r--r--src/lua/common/je_lua_proxy.h (renamed from src/lua/common/Proxy.h)2
-rw-r--r--src/lua/common/je_lua_reference.hpp (renamed from src/lua/common/Reference.hpp)0
8 files changed, 45 insertions, 37 deletions
diff --git a/src/lua/common/common.h b/src/lua/common/common.h
deleted file mode 100644
index 0ee72cc..0000000
--- a/src/lua/common/common.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __JIN_M_TYPES_H
-#define __JIN_M_TYPES_H
-
-#include "Proxy.h"
-#include "Reference.hpp"
-#include "error.h"
-
-#endif \ No newline at end of file
diff --git a/src/lua/common/error.h b/src/lua/common/error.h
deleted file mode 100644
index c254486..0000000
--- a/src/lua/common/error.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef __JIN_ERROR_H
-#define __JIN_ERROR_H
-#include "../../luax.h"
-#include "../jin.h"
-#include <string.h>
-
-namespace JinEngine
-{
-namespace Lua
-{
-
- static const int FORMAT_MSG_BUFFER_SIZE = 2048;
-
- inline void error(lua_State* L, const char* fmt, ...)
- {
- char err[FORMAT_MSG_BUFFER_SIZE + 1] = { 0 };
- va_list args;
- va_start(args, fmt);
- vsnprintf(err + strlen(err), FORMAT_MSG_BUFFER_SIZE, fmt, args);
- va_end(args);
- luax_getglobal(L, MODULE_NAME);
- luax_setfieldstring(L, "error", err);
- }
-
-}
-}
-
-#endif \ No newline at end of file
diff --git a/src/lua/common/je_lua_common.h b/src/lua/common/je_lua_common.h
new file mode 100644
index 0000000..1d772a5
--- /dev/null
+++ b/src/lua/common/je_lua_common.h
@@ -0,0 +1,9 @@
+#ifndef __JIN_M_TYPES_H
+#define __JIN_M_TYPES_H
+
+#include "je_lua_port.h"
+#include "je_lua_proxy.h"
+#include "je_lua_reference.hpp"
+#include "je_lua_error.h"
+
+#endif \ No newline at end of file
diff --git a/src/lua/common/constant.h b/src/lua/common/je_lua_constant.h
index 6f70f09..6f70f09 100644
--- a/src/lua/common/constant.h
+++ b/src/lua/common/je_lua_constant.h
diff --git a/src/lua/common/je_lua_error.h b/src/lua/common/je_lua_error.h
new file mode 100644
index 0000000..fd21b41
--- /dev/null
+++ b/src/lua/common/je_lua_error.h
@@ -0,0 +1,27 @@
+#ifndef __JIN_ERROR_H
+#define __JIN_ERROR_H
+#include "../luax.h"
+#include <string.h>
+
+namespace JinEngine
+{
+ namespace Lua
+ {
+
+ static const int FORMAT_MSG_BUFFER_SIZE = 2048;
+
+ inline void error(lua_State* L, const char* fmt, ...)
+ {
+ char err[FORMAT_MSG_BUFFER_SIZE + 1] = { 0 };
+ va_list args;
+ va_start(args, fmt);
+ vsnprintf(err + strlen(err), FORMAT_MSG_BUFFER_SIZE, fmt, args);
+ va_end(args);
+ luax_getglobal(L, "jin");
+ luax_setfieldstring(L, "error", err);
+ }
+
+ }
+}
+
+#endif \ No newline at end of file
diff --git a/src/lua/common/je_lua_port.h b/src/lua/common/je_lua_port.h
new file mode 100644
index 0000000..8e99ca4
--- /dev/null
+++ b/src/lua/common/je_lua_port.h
@@ -0,0 +1,8 @@
+#ifndef __JE_LUA_PORT_H
+#define __JE_LUA_PORT_H
+
+#define LUA_PORT extern
+#define LUA_IMPLEMENT static
+#define LUA_EXPORT
+
+#endif \ No newline at end of file
diff --git a/src/lua/common/Proxy.h b/src/lua/common/je_lua_proxy.h
index 5ebb5b2..b428dc9 100644
--- a/src/lua/common/Proxy.h
+++ b/src/lua/common/je_lua_proxy.h
@@ -1,7 +1,7 @@
#ifndef __JIN_COMMON_PROXY_H
#define __JIN_COMMON_PROXY_H
-#include "Reference.hpp"
+#include "je_lua_reference.hpp"
namespace JinEngine
{
diff --git a/src/lua/common/Reference.hpp b/src/lua/common/je_lua_reference.hpp
index ba918bb..ba918bb 100644
--- a/src/lua/common/Reference.hpp
+++ b/src/lua/common/je_lua_reference.hpp