diff options
Diffstat (limited to 'src/keeper.h')
-rw-r--r-- | src/keeper.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/keeper.h b/src/keeper.h index 5a52f3b..450f64d 100644 --- a/src/keeper.h +++ b/src/keeper.h | |||
@@ -3,19 +3,25 @@ | |||
3 | 3 | ||
4 | struct s_Keeper | 4 | struct s_Keeper |
5 | { | 5 | { |
6 | MUTEX_T lock_; | 6 | MUTEX_T keeper_cs; |
7 | lua_State *L; | 7 | lua_State* L; |
8 | //int count; | 8 | //int count; |
9 | }; | 9 | }; |
10 | 10 | ||
11 | int init_keepers( lua_State* L); | 11 | struct s_Keepers |
12 | void close_keepers( lua_State* L); | 12 | { |
13 | int nb_keepers; | ||
14 | struct s_Keeper keeper_array[1]; | ||
15 | }; | ||
16 | |||
17 | void init_keepers( struct s_Universe* U, lua_State* L); | ||
18 | void close_keepers( struct s_Universe* U, lua_State* L); | ||
13 | 19 | ||
14 | struct s_Keeper *keeper_acquire( unsigned long magic_); | 20 | struct s_Keeper* keeper_acquire( struct s_Keepers* keepers_, unsigned long magic_); |
15 | #define KEEPER_MAGIC_SHIFT 3 | 21 | #define KEEPER_MAGIC_SHIFT 3 |
16 | void keeper_release( struct s_Keeper* K); | 22 | void keeper_release( struct s_Keeper* K); |
17 | void keeper_toggle_nil_sentinels( lua_State *L, int _val_i, enum eLookupMode const mode_); | 23 | void keeper_toggle_nil_sentinels( lua_State* L, int _val_i, enum eLookupMode const mode_); |
18 | int keeper_push_linda_storage( lua_State* L, void* ptr, unsigned long magic_); | 24 | int keeper_push_linda_storage( struct s_Universe* U, lua_State* L, void* ptr, unsigned long magic_); |
19 | 25 | ||
20 | typedef lua_CFunction keeper_api_t; | 26 | typedef lua_CFunction keeper_api_t; |
21 | #define KEEPER_API( _op) keepercall_ ## _op | 27 | #define KEEPER_API( _op) keepercall_ ## _op |
@@ -30,6 +36,6 @@ int keepercall_get( lua_State* L); | |||
30 | int keepercall_set( lua_State* L); | 36 | int keepercall_set( lua_State* L); |
31 | int keepercall_count( lua_State* L); | 37 | int keepercall_count( lua_State* L); |
32 | 38 | ||
33 | int keeper_call( lua_State *K, keeper_api_t _func, lua_State *L, void *linda, uint_t starting_index); | 39 | int keeper_call( struct s_Universe* U, lua_State* K, keeper_api_t _func, lua_State* L, void* linda, uint_t starting_index); |
34 | 40 | ||
35 | #endif // __keeper_h__ \ No newline at end of file | 41 | #endif // __keeper_h__ \ No newline at end of file |