aboutsummaryrefslogtreecommitdiff
path: root/src/deep.h
diff options
context:
space:
mode:
authorBenoit Germain <b n t DOT g e r m a i n AT g m a i l DOT c o m>2018-10-29 13:39:49 +0100
committerBenoit Germain <b n t DOT g e r m a i n AT g m a i l DOT c o m>2018-10-29 13:39:49 +0100
commitea9e8a3af1c2357c454ef18c8136c14a22b8675a (patch)
tree0b089ae8b94d7901db8c86051fb001bf5936bc54 /src/deep.h
parente2908369e92b14e661b16401b6389d6d4a026278 (diff)
parentdebc6b3403077fc5bd1d144d779806fdd22ab55e (diff)
downloadlanes-ea9e8a3af1c2357c454ef18c8136c14a22b8675a.tar.gz
lanes-ea9e8a3af1c2357c454ef18c8136c14a22b8675a.tar.bz2
lanes-ea9e8a3af1c2357c454ef18c8136c14a22b8675a.zip
Merge changes
Diffstat (limited to 'src/deep.h')
-rw-r--r--src/deep.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/deep.h b/src/deep.h
index 8e999d6..aeeb828 100644
--- a/src/deep.h
+++ b/src/deep.h
@@ -6,14 +6,22 @@
6 * said modules will have to link against lanes (it is not really possible to separate the 'deep userdata' implementation from the rest of Lanes) 6 * said modules will have to link against lanes (it is not really possible to separate the 'deep userdata' implementation from the rest of Lanes)
7 */ 7 */
8 8
9
10#include "lua.h" 9#include "lua.h"
10#include "platform.h"
11
12// forwards
13struct s_Universe;
14typedef struct s_Universe Universe;
15enum eLookupMode;
16typedef enum eLookupMode LookupMode;
11 17
18#if !defined LANES_API // when deep is compiled standalone outside Lanes
12#if (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC) 19#if (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC)
13#define LANES_API __declspec(dllexport) 20#define LANES_API __declspec(dllexport)
14#else 21#else
15#define LANES_API 22#define LANES_API
16#endif // (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC) 23#endif // (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC)
24#endif // LANES_API
17 25
18enum eDeepOp 26enum eDeepOp
19{ 27{
@@ -25,6 +33,21 @@ enum eDeepOp
25 33
26typedef void* (*luaG_IdFunction)( lua_State* L, enum eDeepOp op_); 34typedef void* (*luaG_IdFunction)( lua_State* L, enum eDeepOp op_);
27 35
36// ################################################################################################
37
38// this is pointed to by full userdata proxies, and allocated with malloc() to survive any lua_State lifetime
39struct s_DeepPrelude
40{
41 volatile int refcount;
42 void* deep;
43 // when stored in a keeper state, the full userdata doesn't have a metatable, so we need direct access to the idfunc
44 luaG_IdFunction idfunc;
45};
46typedef struct s_DeepPrelude DeepPrelude;
47
48char const* push_deep_proxy( Universe* U, lua_State* L, DeepPrelude* prelude, LookupMode mode_);
49void free_deep_prelude( lua_State* L, DeepPrelude* prelude_);
50
28extern LANES_API int luaG_newdeepuserdata( lua_State* L, luaG_IdFunction idfunc); 51extern LANES_API int luaG_newdeepuserdata( lua_State* L, luaG_IdFunction idfunc);
29extern LANES_API void* luaG_todeep( lua_State* L, luaG_IdFunction idfunc, int index); 52extern LANES_API void* luaG_todeep( lua_State* L, luaG_IdFunction idfunc, int index);
30extern LANES_API void luaG_pushdeepversion( lua_State* L); 53extern LANES_API void luaG_pushdeepversion( lua_State* L);