From: John L. <jr...@us...> - 2008-12-03 05:26:08
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv3179/wxLua/modules/wxlua/include Modified Files: wxlstate.h Log Message: Make wxLuaEdit print items on the stack and use '=' as the Lua executable. Changed wxLuaState::RunBuffer() to take const char*, not const unsigned char*. Allow wxLuaState::RunString/Buffer() to leave values on the stack. Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** wxlstate.h 26 Mar 2008 05:01:33 -0000 1.121 --- wxlstate.h 3 Dec 2008 05:26:03 -0000 1.122 *************** *** 789,816 **** // Run a Lua file from disk using lua_loadfile() then LuaPCall(). ! // Leaves nothing on the stack. // Returns 0 on success or Lua's error code. // Sends a wxEVT_LUA_ERROR wxLuaEvent on error. ! int RunFile(const wxString &fileName); // Run a string that contains Lua code using luaL_loadbuffer() then LuaPCall(). ! // Leaves nothing on the stack. // Returns 0 on success or Lua's error code. // Sends a wxEVT_LUA_ERROR wxLuaEvent on error. ! int RunString(const wxString &script, const wxString& name = wxEmptyString); // Run a char array #included from bin2c compilation or something else // using luaL_loadbuffer() then LuaPCall(). ! // Leaves nothing on the stack. // Returns 0 on success or Lua's error code. // Sends a wxEVT_LUA_ERROR wxLuaEvent on error. ! int RunBuffer(const unsigned char buf[], size_t size, const wxString &name = wxT("= lua")); ! int LuaDoString(const wxString &script, const wxString& name = wxEmptyString) { return RunString(script, name); } ! int LuaDoFile(const wxString &filename) { return RunFile(filename); } ! int LuaDoBuffer(const char *buffer, size_t len, const char *name) { return RunBuffer((const unsigned char*)buffer, len, lua2wx(name)); } // Is a program running now, running state is set for Run/File/String/Buffer bool IsRunning() const; ! // Replacement for lua_pcall(), leaves nothing on the stack even on error. // Returns 0 on success or Lua's error code. // Sends a wxEVT_LUA_ERROR wxLuaEvent on error. --- 789,816 ---- // Run a Lua file from disk using lua_loadfile() then LuaPCall(). ! // Leaves nresults on the stack, use LUA_MULTRET to leave them all. // Returns 0 on success or Lua's error code. // Sends a wxEVT_LUA_ERROR wxLuaEvent on error. ! int RunFile(const wxString &fileName, int nresults = 0); // Run a string that contains Lua code using luaL_loadbuffer() then LuaPCall(). ! // Leaves nresults on the stack, use LUA_MULTRET to leave them all. // Returns 0 on success or Lua's error code. // Sends a wxEVT_LUA_ERROR wxLuaEvent on error. ! int RunString(const wxString &script, const wxString& name = wxEmptyString, int nresults = 0); // Run a char array #included from bin2c compilation or something else // using luaL_loadbuffer() then LuaPCall(). ! // Leaves nresults on the stack, use LUA_MULTRET to leave them all. // Returns 0 on success or Lua's error code. // Sends a wxEVT_LUA_ERROR wxLuaEvent on error. ! int RunBuffer(const char buf[], size_t size, const wxString &name = wxT("= lua"), int nresults = 0); ! int LuaDoString(const wxString &script, const wxString& name = wxEmptyString, int nresults = 0) { return RunString(script, name, nresults); } ! int LuaDoFile(const wxString &filename, int nresults = 0) { return RunFile(filename, nresults); } ! int LuaDoBuffer(const char *buffer, size_t len, const char *name, int nresults = 0) { return RunBuffer(buffer, len, lua2wx(name), nresults); } // Is a program running now, running state is set for Run/File/String/Buffer bool IsRunning() const; ! // Replacement for lua_pcall() // Returns 0 on success or Lua's error code. // Sends a wxEVT_LUA_ERROR wxLuaEvent on error. *************** *** 838,842 **** int CompileString(const wxString &script, const wxString& name = wxEmptyString, wxString* errMsg = NULL, int* line_num = NULL); ! int CompileBuffer(const unsigned char buf[], size_t size, const wxString &name = wxEmptyString, wxString* errMsg = NULL, int* line_num = NULL); --- 838,842 ---- int CompileString(const wxString &script, const wxString& name = wxEmptyString, wxString* errMsg = NULL, int* line_num = NULL); ! int CompileBuffer(const char buf[], size_t size, const wxString &name = wxEmptyString, wxString* errMsg = NULL, int* line_num = NULL); |