Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/src
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3556/wxLua/modules/wxluasocket/src
Modified Files:
wxldtarg.cpp
Log Message:
* Changed wxLuaState_Type enum for wxLuaState(lua_State*, wxLuaState_Type)
Removed wxLUASTATE_USESTATE and you now | together wxLUASTATE_SETSTATE with
wxLUASTATE_OPENBINDINGS if you want the bindings opened.
Cleans up the creation of the wxLuaState so a precreated lua_State
should be able to be used easier.
- Remove poorly named wxLuaState::LuaError() and CheckRunError() and
replaced them with the C functions wxlua_errorinfo() and wxlua_LUA_ERR_msg()
respectively.
- Added wxlua_pushargs(wxChar**, int) for a standard way to push args
into Lua.
- Copy Lua's print() function to print_lua() instead of simply
overwriting it in case someone really wants to use it.
Index: wxldtarg.cpp
===================================================================
RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxldtarg.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** wxldtarg.cpp 22 Dec 2007 06:07:17 -0000 1.44
--- wxldtarg.cpp 15 Jan 2008 01:04:04 -0000 1.45
***************
*** 128,145 ****
for (idx = 0; idx < count; ++idx)
{
- int rc = LUA_ERRERR;
-
wxString luaBuffer = m_bufferArray.Item(idx);
wxString bufFilename = luaBuffer.BeforeFirst(wxT('\0'));
wxString buf = luaBuffer.AfterFirst(wxT('\0'));
! rc = m_wxlState.LuaDoBuffer(wx2lua(buf), buf.Length(),
wx2lua(bufFilename));
! wxString errorMsg;
! m_fErrorsSeen = !wxLuaState::CheckRunError(rc, &errorMsg);
if (m_fErrorsSeen)
{
! NotifyError(errorMsg);
break;
}
--- 128,142 ----
for (idx = 0; idx < count; ++idx)
{
wxString luaBuffer = m_bufferArray.Item(idx);
wxString bufFilename = luaBuffer.BeforeFirst(wxT('\0'));
wxString buf = luaBuffer.AfterFirst(wxT('\0'));
! int rc = m_wxlState.LuaDoBuffer(wx2lua(buf), buf.Length(),
wx2lua(bufFilename));
! m_fErrorsSeen = (rc != 0);
if (m_fErrorsSeen)
{
! NotifyError(wxlua_LUA_ERR_msg(rc));
break;
}
***************
*** 503,509 ****
nResult = lua_pcall(L, 0, LUA_MULTRET, 0); // call main
! wxString errorMsg;
! if (!wxLuaState::CheckRunError(nResult, &errorMsg))
! lua_pushlstring(L, wx2lua(errorMsg), errorMsg.Len());
else if (lua_gettop(L) == nOldTop)
lua_pushliteral(L, "OK");
--- 500,506 ----
nResult = lua_pcall(L, 0, LUA_MULTRET, 0); // call main
! if (nResult != 0)
! wxlua_pushwxString(L, wxlua_LUA_ERR_msg(nResult));
!
else if (lua_gettop(L) == nOldTop)
lua_pushliteral(L, "OK");
|