diff options
Diffstat (limited to 'src/keeper.h')
-rw-r--r-- | src/keeper.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/keeper.h b/src/keeper.h index 6c4c6f9..a0ea8c5 100644 --- a/src/keeper.h +++ b/src/keeper.h | |||
@@ -13,7 +13,30 @@ void populate_keepers( lua_State *L); | |||
13 | struct s_Keeper *keeper_acquire( const void *ptr); | 13 | struct s_Keeper *keeper_acquire( const void *ptr); |
14 | void keeper_release( struct s_Keeper *K); | 14 | void keeper_release( struct s_Keeper *K); |
15 | void keeper_toggle_nil_sentinels( lua_State *L, int _val_i, int _nil_to_sentinel); | 15 | void keeper_toggle_nil_sentinels( lua_State *L, int _val_i, int _nil_to_sentinel); |
16 | int keeper_call( lua_State *K, char const *func_name, lua_State *L, void *linda, uint_t starting_index); | ||
17 | 16 | ||
17 | #define KEEPER_MODEL_LUA 1 | ||
18 | #define KEEPER_MODEL_C 2 | ||
19 | #define KEEPER_MODEL KEEPER_MODEL_C | ||
20 | |||
21 | #if KEEPER_MODEL == KEEPER_MODEL_LUA | ||
22 | typedef char const* keeper_api_t; | ||
23 | #define KEEPER_API( _op) #_op | ||
24 | #define PUSH_KEEPER_FUNC( K, _api) lua_getglobal( K, _api) | ||
25 | #elif KEEPER_MODEL == KEEPER_MODEL_C | ||
26 | typedef lua_CFunction keeper_api_t; | ||
27 | #define KEEPER_API( _op) keepercall_ ## _op | ||
28 | #define PUSH_KEEPER_FUNC lua_pushcfunction | ||
29 | // lua_Cfunctions to run inside a keeper state (formerly implemented in Lua) | ||
30 | int keepercall_clear( lua_State* L); | ||
31 | int keepercall_send( lua_State* L); | ||
32 | int keepercall_receive( lua_State* L); | ||
33 | int keepercall_receive_batched( lua_State* L); | ||
34 | int keepercall_limit( lua_State* L); | ||
35 | int keepercall_get( lua_State* L); | ||
36 | int keepercall_set( lua_State* L); | ||
37 | int keepercall_count( lua_State* L); | ||
38 | #endif // KEEPER_MODEL | ||
39 | |||
40 | int keeper_call( lua_State *K, keeper_api_t _func, lua_State *L, void *linda, uint_t starting_index); | ||
18 | 41 | ||
19 | #endif // __keeper_h__ \ No newline at end of file | 42 | #endif // __keeper_h__ \ No newline at end of file |