From 575615c5a41592f3701853f90e1762c6dce4abe4 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Fri, 12 Jan 2018 18:36:46 +0330 Subject: you can now run objects that are loaded into bruiser from a shared library from lua. right now very simple examples work. i have to figure out how to handles runtime pointer recasts. --- bruiser/executioner.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bruiser/executioner.h') diff --git a/bruiser/executioner.h b/bruiser/executioner.h index 0113d6c..26bd042 100644 --- a/bruiser/executioner.h +++ b/bruiser/executioner.h @@ -36,6 +36,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.* /**********************************************************************************************************************/ namespace { // start of anonymous namespace using XObject = void(*)(void); + using xobj_2int = int(*)(int, int); + using LuaRegFunc = int(*)(lua_State*); constexpr int MEMORY_SIZE = 32768; std::vector memory(MEMORY_SIZE, 0); @@ -178,10 +180,7 @@ class Executioner { std::vector getAllArgs(lua_State* __ls) { int numargs = lua_gettop(__ls); std::vector args; - - for (int i = 0; i < numargs; ++i) { - } - + for (int i = 0; i < numargs; ++i) {} return args; } @@ -203,6 +202,8 @@ class Executioner { lua_register(_lua_State, "xobjwrapper", LuaXobjWrapper); } + XObject getXobject(void* _ptr) {return (XObject)_ptr;} + void xobjsGetPtrs(void) { for (auto& iter : obj_mem_ptrs) { XObject dummy = (XObject)iter.first; -- cgit v1.2.3