summaryrefslogtreecommitdiff
path: root/src/keeper.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/keeper.h')
-rw-r--r--src/keeper.h25
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);
13struct s_Keeper *keeper_acquire( const void *ptr); 13struct s_Keeper *keeper_acquire( const void *ptr);
14void keeper_release( struct s_Keeper *K); 14void keeper_release( struct s_Keeper *K);
15void keeper_toggle_nil_sentinels( lua_State *L, int _val_i, int _nil_to_sentinel); 15void keeper_toggle_nil_sentinels( lua_State *L, int _val_i, int _nil_to_sentinel);
16int 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
22typedef 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
26typedef 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)
30int keepercall_clear( lua_State* L);
31int keepercall_send( lua_State* L);
32int keepercall_receive( lua_State* L);
33int keepercall_receive_batched( lua_State* L);
34int keepercall_limit( lua_State* L);
35int keepercall_get( lua_State* L);
36int keepercall_set( lua_State* L);
37int keepercall_count( lua_State* L);
38#endif // KEEPER_MODEL
39
40int 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