aboutsummaryrefslogtreecommitdiff
path: root/src/deep.h
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2018-10-25 14:03:32 +0200
committerBenoit Germain <bnt.germain@gmail.com>2018-10-25 14:03:32 +0200
commit9645a86fbcb16ca83c5f4ff0dae0925ac71bb46b (patch)
treec47a5f4ea54490ed969b5ebdf1a2174c29e49ff5 /src/deep.h
parent1ec3f220f345f1c090a18adbaa90c0ead61e8ed3 (diff)
downloadlanes-9645a86fbcb16ca83c5f4ff0dae0925ac71bb46b.tar.gz
lanes-9645a86fbcb16ca83c5f4ff0dae0925ac71bb46b.tar.bz2
lanes-9645a86fbcb16ca83c5f4ff0dae0925ac71bb46b.zip
Fix Lanes build by reorganizing types around a bit
Diffstat (limited to 'src/deep.h')
-rw-r--r--src/deep.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/deep.h b/src/deep.h
index 8e999d6..366c5a8 100644
--- a/src/deep.h
+++ b/src/deep.h
@@ -6,14 +6,19 @@
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"
11 10
11// forwards
12struct s_Universe;
13typedef struct s_Universe Universe;
14
15#if !defined LANES_API // when deep is compiled standalone outside Lanes
12#if (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC) 16#if (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC)
13#define LANES_API __declspec(dllexport) 17#define LANES_API __declspec(dllexport)
14#else 18#else
15#define LANES_API 19#define LANES_API
16#endif // (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC) 20#endif // (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC)
21#endif // LANES_API
17 22
18enum eDeepOp 23enum eDeepOp
19{ 24{
@@ -25,6 +30,21 @@ enum eDeepOp
25 30
26typedef void* (*luaG_IdFunction)( lua_State* L, enum eDeepOp op_); 31typedef void* (*luaG_IdFunction)( lua_State* L, enum eDeepOp op_);
27 32
33// ################################################################################################
34
35// this is pointed to by full userdata proxies, and allocated with malloc() to survive any lua_State lifetime
36struct s_DeepPrelude
37{
38 volatile int refcount;
39 void* deep;
40 // when stored in a keeper state, the full userdata doesn't have a metatable, so we need direct access to the idfunc
41 luaG_IdFunction idfunc;
42};
43typedef struct s_DeepPrelude DeepPrelude;
44
45char const* push_deep_proxy( Universe* U, lua_State* L, DeepPrelude* prelude, enum eLookupMode mode_);
46void free_deep_prelude( lua_State* L, DeepPrelude* prelude_);
47
28extern LANES_API int luaG_newdeepuserdata( lua_State* L, luaG_IdFunction idfunc); 48extern 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); 49extern LANES_API void* luaG_todeep( lua_State* L, luaG_IdFunction idfunc, int index);
30extern LANES_API void luaG_pushdeepversion( lua_State* L); 50extern LANES_API void luaG_pushdeepversion( lua_State* L);