From 47eb3f94373a13ac9f204ca65dfde602f53bdc1a Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Mon, 17 Feb 2014 11:05:19 +0100 Subject: Deep userdata support improvements * bumped version to 3.9.0 * keepers now require "package", receive package.path & package.cpath, and call on_state_create() if it is a C function * changed the deep public API (improved deep idfunc signature, renamed luaG_deep_userdata to luaG_newdeepuserdata) * if an error occurs while copying a deep userdata, don't raise inside the keeper state * fixed situations where raised errors could lead to memory leaks (deep gc) --- src/deep.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/deep.h') diff --git a/src/deep.h b/src/deep.h index 1315157..e1f2c4f 100644 --- a/src/deep.h +++ b/src/deep.h @@ -15,9 +15,17 @@ #define LANES_API #endif // (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC) -typedef void (*luaG_IdFunction)( lua_State* L, char const* const which); +enum eDeepOp +{ + eDO_new, + eDO_delete, + eDO_metatable, + eDO_module, +}; -extern LANES_API int luaG_deep_userdata( lua_State* L, luaG_IdFunction idfunc); +typedef void* (*luaG_IdFunction)( lua_State* L, enum eDeepOp op_); + +extern LANES_API int luaG_newdeepuserdata( lua_State* L, luaG_IdFunction idfunc); extern LANES_API void* luaG_todeep( lua_State* L, luaG_IdFunction idfunc, int index); #endif // __LANES_DEEP_H__ -- cgit v1.2.3-55-g6feb