aboutsummaryrefslogtreecommitdiff
path: root/src/libjin-lua/common/je_lua.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-12-20 18:34:50 +0800
committerchai <chaifix@163.com>2018-12-20 18:34:50 +0800
commitee8ef0433e36bf354a717bd4af679a0a5af2e6be (patch)
tree2fc748510200f8bc24928d1938300eecc0604deb /src/libjin-lua/common/je_lua.h
parent7ae40127f15f8f2cb963a7efeb018f7887ebc1ea (diff)
*修改文件结构
Diffstat (limited to 'src/libjin-lua/common/je_lua.h')
-rw-r--r--src/libjin-lua/common/je_lua.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/libjin-lua/common/je_lua.h b/src/libjin-lua/common/je_lua.h
new file mode 100644
index 0000000..74f9819
--- /dev/null
+++ b/src/libjin-lua/common/je_lua.h
@@ -0,0 +1,83 @@
+#ifndef __JE_LUA_H__
+#define __JE_LUA_H__
+
+#include <vector>
+
+#include "LuaJIT/lua.hpp"
+#include "luax/luax.h"
+
+#include "je_lua_shared.hpp"
+#include "je_lua_object.h"
+#include "je_lua_reference.h"
+
+namespace JinEngine
+{
+ namespace Lua
+ {
+
+ // Extends luax.h library.
+
+ ///
+ ///
+ ///
+ LuaObject* luax_newinstance(lua_State* L, const char* type, Shared* shared);
+
+ ///
+ /// Copy instance to another lua state.
+ ///
+ LuaObject* luax_copyinstance(lua_State* to, LuaObject* src);
+
+ ///
+ ///
+ ///
+ LuaObject* luax_checkobject(lua_State* L, int idx, const char* type);
+
+ ///
+ /// Access lua object by object pointer.
+ ///
+ int luax_getobject(lua_State* L, LuaObject* obj);
+
+ ///
+ /// Get object's reference table.
+ ///
+ void luax_getreference(lua_State* L, LuaObject* obj);
+
+ ///
+ ///
+ ///
+ bool luax_addreference(lua_State* L, LuaObject* obj, LuaObject* dep);
+
+ ///
+ ///
+ ///
+ void luax_removereference(lua_State* L, LuaObject* obj);
+
+ ///
+ ///
+ ///
+ void luax_removereference(lua_State* L, LuaObject* obj, LuaObject* dep);
+
+ ///
+ ///
+ ///
+ void luax_removeobject(lua_State* L, LuaObject* obj);
+
+ ///
+ ///
+ ///
+ int luax_getobjectstable(lua_State* L);
+
+ ///
+ ///
+ ///
+ int luax_getmodulestable(lua_State* L);
+
+ ///
+ ///
+ ///
+ int luax_getreferencestable(lua_State* L);
+
+ }
+}
+
+#endif \ No newline at end of file