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/tools.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/tools.h')
-rw-r--r-- | src/tools.h | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/src/tools.h b/src/tools.h index 9155747..ac69074 100644 --- a/src/tools.h +++ b/src/tools.h | |||
@@ -1,28 +1,15 @@ | |||
1 | /* | 1 | #ifndef __LANES_TOOLS_H__ |
2 | * TOOLS.H | 2 | #define __LANES_TOOLS_H__ |
3 | */ | ||
4 | #ifndef TOOLS_H | ||
5 | #define TOOLS_H | ||
6 | 3 | ||
7 | #include "lauxlib.h" | 4 | //#include "lauxlib.h" |
8 | #include "threading.h" | 5 | #include "threading.h" |
9 | #include "deep.h" | 6 | #include "deep.h" |
10 | // MUTEX_T | ||
11 | |||
12 | #include <assert.h> | ||
13 | 7 | ||
14 | #include "macros_and_utils.h" | 8 | #include "macros_and_utils.h" |
15 | 9 | ||
16 | // ################################################################################################ | 10 | // forwards |
17 | 11 | struct s_Universe; | |
18 | // this is pointed to by full userdata proxies, and allocated with malloc() to survive any lua_State lifetime | 12 | typedef struct s_Universe Universe; |
19 | struct DEEP_PRELUDE | ||
20 | { | ||
21 | volatile int refcount; | ||
22 | void* deep; | ||
23 | // when stored in a keeper state, the full userdata doesn't have a metatable, so we need direct access to the idfunc | ||
24 | luaG_IdFunction idfunc; | ||
25 | }; | ||
26 | 13 | ||
27 | // ################################################################################################ | 14 | // ################################################################################################ |
28 | 15 | ||
@@ -33,8 +20,8 @@ struct DEEP_PRELUDE | |||
33 | 20 | ||
34 | void luaG_dump( lua_State* L ); | 21 | void luaG_dump( lua_State* L ); |
35 | 22 | ||
36 | lua_State* luaG_newstate( struct s_Universe* U, lua_State* _from, char const* libs); | 23 | lua_State* luaG_newstate( Universe* U, lua_State* _from, char const* libs); |
37 | void luaG_copy_one_time_settings( struct s_Universe* U, lua_State* L, lua_State* L2); | 24 | void luaG_copy_one_time_settings( Universe* U, lua_State* L, lua_State* L2); |
38 | 25 | ||
39 | // ################################################################################################ | 26 | // ################################################################################################ |
40 | 27 | ||
@@ -45,25 +32,22 @@ enum eLookupMode | |||
45 | eLM_FromKeeper // send a function from a keeper state to a lane | 32 | eLM_FromKeeper // send a function from a keeper state to a lane |
46 | }; | 33 | }; |
47 | 34 | ||
48 | char const* push_deep_proxy( struct s_Universe* U, lua_State* L, struct DEEP_PRELUDE* prelude, enum eLookupMode mode_); | 35 | int luaG_inter_copy_package( Universe* U, lua_State* L, lua_State* L2, int package_idx_, enum eLookupMode mode_); |
49 | void free_deep_prelude( lua_State* L, struct DEEP_PRELUDE* prelude_); | ||
50 | |||
51 | int luaG_inter_copy_package( struct s_Universe* U, lua_State* L, lua_State* L2, int package_idx_, enum eLookupMode mode_); | ||
52 | 36 | ||
53 | int luaG_inter_copy( struct s_Universe* U, lua_State* L, lua_State* L2, uint_t n, enum eLookupMode mode_); | 37 | int luaG_inter_copy( Universe* U, lua_State* L, lua_State* L2, uint_t n, enum eLookupMode mode_); |
54 | int luaG_inter_move( struct s_Universe* U, lua_State* L, lua_State* L2, uint_t n, enum eLookupMode mode_); | 38 | int luaG_inter_move( Universe* U, lua_State* L, lua_State* L2, uint_t n, enum eLookupMode mode_); |
55 | 39 | ||
56 | int luaG_nameof( lua_State* L); | 40 | int luaG_nameof( lua_State* L); |
57 | int luaG_new_require( lua_State* L); | 41 | int luaG_new_require( lua_State* L); |
58 | 42 | ||
59 | void populate_func_lookup_table( lua_State* L, int _i, char const* _name); | 43 | void populate_func_lookup_table( lua_State* L, int _i, char const* _name); |
60 | void serialize_require( struct s_Universe* U, lua_State *L); | 44 | void serialize_require( Universe* U, lua_State *L); |
61 | void initialize_on_state_create( struct s_Universe* U, lua_State* L); | 45 | void initialize_on_state_create( Universe* U, lua_State* L); |
62 | void call_on_state_create( struct s_Universe* U, lua_State* L, lua_State* from_, enum eLookupMode mode_); | 46 | void call_on_state_create( Universe* U, lua_State* L, lua_State* from_, enum eLookupMode mode_); |
63 | 47 | ||
64 | // ################################################################################################ | 48 | // ################################################################################################ |
65 | 49 | ||
66 | extern char const* const CONFIG_REGKEY; | 50 | extern char const* const CONFIG_REGKEY; |
67 | extern char const* const LOOKUP_REGKEY; | 51 | extern char const* const LOOKUP_REGKEY; |
68 | 52 | ||
69 | #endif // TOOLS_H | 53 | #endif // __LANES_TOOLS_H__ |