From: John L. <jr...@us...> - 2007-03-21 23:43:15
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16781/wxLua/modules/wxlua/include Modified Files: wxlstate.h Log Message: Use luaL_ref and luaL_unref in tinsert and tremove so we can remove the m_unusedReferences array in the wxLuaStateData. All tXXX functions are now C functions and don't depend on the wxLuaState. Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** wxlstate.h 19 Mar 2007 03:47:21 -0000 1.62 --- wxlstate.h 21 Mar 2007 23:43:12 -0000 1.63 *************** *** 113,125 **** // Create a reference to the object at stack index in the // wxLuaReferences registry table, returns the table index. ! //WXDLLIMPEXP_WXLUA int LUACALL wxLua_lua_tinsert(lua_State* L, int stack_idx); // Remove a reference to the object at the index in the // wxLuaReferences registry table, returns success. ! //WXDLLIMPEXP_WXLUA bool LUACALL wxLua_lua_tremove(lua_State* L, int iReference); // Push onto the top of the stack the object at the index in the // wxLuaReferences registry table, returns success. WXDLLIMPEXP_WXLUA bool LUACALL wxLua_lua_tget(lua_State* L, int wxlref_index); - // Get the number of items in the wxLuaReferences registry table - WXDLLIMPEXP_WXLUA int LUACALL wxLua_lua_tgetn(lua_State* L); // Push the errorMsg on the stack and call lua_error WXDLLIMPEXP_WXLUA void LUACALL wxLua_lua_terror(lua_State* L, const char* errorMsg); --- 113,123 ---- // Create a reference to the object at stack index in the // wxLuaReferences registry table, returns the table index. ! WXDLLIMPEXP_WXLUA int LUACALL wxLua_lua_tinsert(lua_State* L, int stack_idx); // Remove a reference to the object at the index in the // wxLuaReferences registry table, returns success. ! WXDLLIMPEXP_WXLUA bool LUACALL wxLua_lua_tremove(lua_State* L, int iReference); // Push onto the top of the stack the object at the index in the // wxLuaReferences registry table, returns success. WXDLLIMPEXP_WXLUA bool LUACALL wxLua_lua_tget(lua_State* L, int wxlref_index); // Push the errorMsg on the stack and call lua_error WXDLLIMPEXP_WXLUA void LUACALL wxLua_lua_terror(lua_State* L, const char* errorMsg); *************** *** 134,142 **** // Allocate a new table (metatable) tinsert it into the wxLuaReferences registry table // and return its index into the ref table. ! //WXDLLIMPEXP_WXLUA int LUACALL wxLua_lua_tnewtag(lua_State* L); // Create a new table and its metatable with weak keys and/or values by setting the // metatable's __weak index to [k/v]. The table is tinsert into the wxLuaReferences // registry table and return its index into the ref table. ! //WXDLLIMPEXP_WXLUA int LUACALL wxLua_lua_tnewweaktag(lua_State* L, bool weak_keys, bool weak_values); // Set the metatable of the object at top of stack to tget(tag) WXDLLIMPEXP_WXLUA void LUACALL wxLua_lua_tsettag(lua_State* L, int tag); --- 132,140 ---- // Allocate a new table (metatable) tinsert it into the wxLuaReferences registry table // and return its index into the ref table. ! WXDLLIMPEXP_WXLUA int LUACALL wxLua_lua_tnewtag(lua_State* L); // Create a new table and its metatable with weak keys and/or values by setting the // metatable's __weak index to [k/v]. The table is tinsert into the wxLuaReferences // registry table and return its index into the ref table. ! WXDLLIMPEXP_WXLUA int LUACALL wxLua_lua_tnewweaktag(lua_State* L, bool weak_keys, bool weak_values); // Set the metatable of the object at top of stack to tget(tag) WXDLLIMPEXP_WXLUA void LUACALL wxLua_lua_tsettag(lua_State* L, int tag); *************** *** 226,231 **** // but for an embedded program they must be deleted before // shutting down the interpreter, else they dangle - wxArrayInt m_unusedReferenceIndexes; // array of unused (available) table indicies in the - // wxLuaReferences registry table bool m_is_running; // is the lua_State running a script --- 224,227 ---- *************** *** 551,556 **** // wxLuaReferences registry table, returns success. bool tget(int wxlref_index); - // Get the number of items in the wxLuaReferences registry table - int tgetn(); // Push the errorMsg on the stack and call lua_error void terror(const char *errorMsg) const; --- 547,550 ---- |