aboutsummaryrefslogtreecommitdiff
path: root/src/tools.h
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2018-10-25 14:03:32 +0200
committerBenoit Germain <bnt.germain@gmail.com>2018-10-25 14:03:32 +0200
commit9645a86fbcb16ca83c5f4ff0dae0925ac71bb46b (patch)
treec47a5f4ea54490ed969b5ebdf1a2174c29e49ff5 /src/tools.h
parent1ec3f220f345f1c090a18adbaa90c0ead61e8ed3 (diff)
downloadlanes-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.h46
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 11struct s_Universe;
18// this is pointed to by full userdata proxies, and allocated with malloc() to survive any lua_State lifetime 12typedef struct s_Universe Universe;
19struct 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
34void luaG_dump( lua_State* L ); 21void luaG_dump( lua_State* L );
35 22
36lua_State* luaG_newstate( struct s_Universe* U, lua_State* _from, char const* libs); 23lua_State* luaG_newstate( Universe* U, lua_State* _from, char const* libs);
37void luaG_copy_one_time_settings( struct s_Universe* U, lua_State* L, lua_State* L2); 24void 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
48char const* push_deep_proxy( struct s_Universe* U, lua_State* L, struct DEEP_PRELUDE* prelude, enum eLookupMode mode_); 35int luaG_inter_copy_package( Universe* U, lua_State* L, lua_State* L2, int package_idx_, enum eLookupMode mode_);
49void free_deep_prelude( lua_State* L, struct DEEP_PRELUDE* prelude_);
50
51int luaG_inter_copy_package( struct s_Universe* U, lua_State* L, lua_State* L2, int package_idx_, enum eLookupMode mode_);
52 36
53int luaG_inter_copy( struct s_Universe* U, lua_State* L, lua_State* L2, uint_t n, enum eLookupMode mode_); 37int luaG_inter_copy( Universe* U, lua_State* L, lua_State* L2, uint_t n, enum eLookupMode mode_);
54int luaG_inter_move( struct s_Universe* U, lua_State* L, lua_State* L2, uint_t n, enum eLookupMode mode_); 38int luaG_inter_move( Universe* U, lua_State* L, lua_State* L2, uint_t n, enum eLookupMode mode_);
55 39
56int luaG_nameof( lua_State* L); 40int luaG_nameof( lua_State* L);
57int luaG_new_require( lua_State* L); 41int luaG_new_require( lua_State* L);
58 42
59void populate_func_lookup_table( lua_State* L, int _i, char const* _name); 43void populate_func_lookup_table( lua_State* L, int _i, char const* _name);
60void serialize_require( struct s_Universe* U, lua_State *L); 44void serialize_require( Universe* U, lua_State *L);
61void initialize_on_state_create( struct s_Universe* U, lua_State* L); 45void initialize_on_state_create( Universe* U, lua_State* L);
62void call_on_state_create( struct s_Universe* U, lua_State* L, lua_State* from_, enum eLookupMode mode_); 46void call_on_state_create( Universe* U, lua_State* L, lua_State* from_, enum eLookupMode mode_);
63 47
64// ################################################################################################ 48// ################################################################################################
65 49
66extern char const* const CONFIG_REGKEY; 50extern char const* const CONFIG_REGKEY;
67extern char const* const LOOKUP_REGKEY; 51extern char const* const LOOKUP_REGKEY;
68 52
69#endif // TOOLS_H 53#endif // __LANES_TOOLS_H__