From ee8ef0433e36bf354a717bd4af679a0a5af2e6be Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 20 Dec 2018 18:34:50 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin-lua/common/je_lua.h | 83 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 src/libjin-lua/common/je_lua.h (limited to 'src/libjin-lua/common/je_lua.h') 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 + +#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 -- cgit v1.1-26-g67d0