diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2018-10-25 14:03:32 +0200 |
---|---|---|
committer | Benoit Germain <bnt.germain@gmail.com> | 2018-10-25 14:03:32 +0200 |
commit | 9645a86fbcb16ca83c5f4ff0dae0925ac71bb46b (patch) | |
tree | c47a5f4ea54490ed969b5ebdf1a2174c29e49ff5 /src/deep.h | |
parent | 1ec3f220f345f1c090a18adbaa90c0ead61e8ed3 (diff) | |
download | lanes-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.h | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -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 | ||
12 | struct s_Universe; | ||
13 | typedef 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 | ||
18 | enum eDeepOp | 23 | enum eDeepOp |
19 | { | 24 | { |
@@ -25,6 +30,21 @@ enum eDeepOp | |||
25 | 30 | ||
26 | typedef void* (*luaG_IdFunction)( lua_State* L, enum eDeepOp op_); | 31 | typedef 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 | ||
36 | struct 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 | }; | ||
43 | typedef struct s_DeepPrelude DeepPrelude; | ||
44 | |||
45 | char const* push_deep_proxy( Universe* U, lua_State* L, DeepPrelude* prelude, enum eLookupMode mode_); | ||
46 | void free_deep_prelude( lua_State* L, DeepPrelude* prelude_); | ||
47 | |||
28 | extern LANES_API int luaG_newdeepuserdata( lua_State* L, luaG_IdFunction idfunc); | 48 | extern LANES_API int luaG_newdeepuserdata( lua_State* L, luaG_IdFunction idfunc); |
29 | extern LANES_API void* luaG_todeep( lua_State* L, luaG_IdFunction idfunc, int index); | 49 | extern LANES_API void* luaG_todeep( lua_State* L, luaG_IdFunction idfunc, int index); |
30 | extern LANES_API void luaG_pushdeepversion( lua_State* L); | 50 | extern LANES_API void luaG_pushdeepversion( lua_State* L); |