diff options
Diffstat (limited to 'src/tools.h')
-rw-r--r-- | src/tools.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/tools.h b/src/tools.h index be358db..ebe407b 100644 --- a/src/tools.h +++ b/src/tools.h | |||
@@ -99,11 +99,15 @@ extern int debugspew_indent_depth; | |||
99 | void luaG_dump( lua_State* L ); | 99 | void luaG_dump( lua_State* L ); |
100 | 100 | ||
101 | lua_State* luaG_newstate( lua_State* _from, char const* libs); | 101 | lua_State* luaG_newstate( lua_State* _from, char const* libs); |
102 | void luaG_copy_one_time_settings( lua_State* L, lua_State* L2, char const* name_); | 102 | void luaG_copy_one_time_settings( lua_State* L, lua_State* L2); |
103 | 103 | ||
104 | typedef struct { | 104 | // this is pointed to by full userdata proxies, and allocated with malloc() to survive any lua_State lifetime |
105 | volatile int refcount; | 105 | typedef struct |
106 | void *deep; | 106 | { |
107 | volatile int refcount; | ||
108 | void* deep; | ||
109 | // when stored in a keeper state, the full userdata doesn't have a metatable, so we need direct access to the idfunc | ||
110 | luaG_IdFunction idfunc; | ||
107 | } DEEP_PRELUDE; | 111 | } DEEP_PRELUDE; |
108 | 112 | ||
109 | enum eLookupMode | 113 | enum eLookupMode |
@@ -113,7 +117,7 @@ enum eLookupMode | |||
113 | eLM_FromKeeper // send a function from a keeper state to a lane | 117 | eLM_FromKeeper // send a function from a keeper state to a lane |
114 | }; | 118 | }; |
115 | 119 | ||
116 | void luaG_push_proxy( lua_State *L, luaG_IdFunction idfunc, DEEP_PRELUDE *deep_userdata); | 120 | char const* push_deep_proxy( lua_State* L, DEEP_PRELUDE* prelude, enum eLookupMode mode_); |
117 | void luaG_inter_copy_package( lua_State* L, lua_State* L2, int _idx, enum eLookupMode mode_); | 121 | void luaG_inter_copy_package( lua_State* L, lua_State* L2, int _idx, enum eLookupMode mode_); |
118 | 122 | ||
119 | int luaG_inter_copy( lua_State *L, lua_State *L2, uint_t n, enum eLookupMode mode_); | 123 | int luaG_inter_copy( lua_State *L, lua_State *L2, uint_t n, enum eLookupMode mode_); |
@@ -130,6 +134,8 @@ extern MUTEX_T mtid_lock; | |||
130 | void populate_func_lookup_table( lua_State* L, int _i, char const* _name); | 134 | void populate_func_lookup_table( lua_State* L, int _i, char const* _name); |
131 | void serialize_require( lua_State *L); | 135 | void serialize_require( lua_State *L); |
132 | int initialize_on_state_create( lua_State *L); | 136 | int initialize_on_state_create( lua_State *L); |
137 | void call_on_state_create( lua_State* L, lua_State* from_, enum eLookupMode mode_); | ||
138 | |||
133 | extern MUTEX_T require_cs; | 139 | extern MUTEX_T require_cs; |
134 | 140 | ||
135 | // for verbose errors | 141 | // for verbose errors |