diff options
author | deva <deva> | 2006-08-25 21:20:07 +0000 |
---|---|---|
committer | deva <deva> | 2006-08-25 21:20:07 +0000 |
commit | 8196872e3b240ef93fc17dd3c05a7d97a8015d88 (patch) | |
tree | e531edeb1c7178a8e58170c84645ce8eb706624e /lib/liblua_wrapper.cc | |
parent | 347b1d8ed3a4f780f3a5c0d57a04eab05ca517a2 (diff) |
Rearranged the network and socket code.origin
Added status messages sent over the network using udp packets.
Diffstat (limited to 'lib/liblua_wrapper.cc')
-rw-r--r-- | lib/liblua_wrapper.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/liblua_wrapper.cc b/lib/liblua_wrapper.cc index 6535f4e..9e06be9 100644 --- a/lib/liblua_wrapper.cc +++ b/lib/liblua_wrapper.cc @@ -51,10 +51,10 @@ int LibLUAWrapper::loadFile(char *fname) case LUA_ERRSYNTAX: //syntax error during pre-compilation; case LUA_ERRMEM: //memory allocation error. case LUA_ERRFILE: //cannot open/read the file. - error = std::string(lua_tostring(L, lua_gettop(L))); + strerr = std::string(lua_tostring(L, lua_gettop(L))); return 1; default: - error = std::string("Unknown return value of luaL_loadfile."); + strerr = std::string("Unknown return value of luaL_loadfile."); return 1; } @@ -66,10 +66,10 @@ int LibLUAWrapper::loadFile(char *fname) case LUA_ERRRUN:// a runtime error. case LUA_ERRMEM:// memory allocation error. For such errors, Lua does not call the error handler function. case LUA_ERRERR:// error while running the error handler function. - error = std::string(lua_tostring(L, lua_gettop(L))); + strerr = std::string(lua_tostring(L, lua_gettop(L))); return 1; default: - error = std::string("Unknown return value of lua_pcall."); + strerr = std::string("Unknown return value of lua_pcall."); return 1; } @@ -87,10 +87,10 @@ int LibLUAWrapper::loadBuffer(char *buffer) break; case LUA_ERRSYNTAX: //syntax error during pre-compilation; case LUA_ERRMEM: //memory allocation error. - error = std::string(lua_tostring(L, lua_gettop(L))); + strerr = std::string(lua_tostring(L, lua_gettop(L))); return 1; default: - error = std::string("Unknown return value of luaL_loadstring."); + strerr = std::string("Unknown return value of luaL_loadstring."); return 1; } @@ -102,10 +102,10 @@ int LibLUAWrapper::loadBuffer(char *buffer) case LUA_ERRRUN:// a runtime error. case LUA_ERRMEM:// memory allocation error. For such errors, Lua does not call the error handler function. case LUA_ERRERR:// error while running the error handler function. - error = std::string(lua_tostring(L, lua_gettop(L))); + strerr = std::string(lua_tostring(L, lua_gettop(L))); return 1; default: - error = std::string("Unknown return value of lua_pcall."); + strerr = std::string("Unknown return value of lua_pcall."); return 1; } @@ -164,9 +164,9 @@ std::string LibLUAWrapper::getString(char *name) return val; } -std::string LibLUAWrapper::getError() +std::string LibLUAWrapper::error() { - return error; + return strerr; } #ifdef LUA_TEST @@ -184,12 +184,12 @@ int main() LibLUAWrapper lua; if(lua.loadBuffer((char*)preload)) { - fprintf(stderr, "LUA buffer error: %s\n", lua.getError().c_str()); + fprintf(stderr, "LUA buffer error: %s\n", lua.error().c_str()); return 1; } if(lua.loadFile("test.lua")) { - fprintf(stderr, "LUA load error: %s\n", lua.getError().c_str()); + fprintf(stderr, "LUA load error: %s\n", lua.error().c_str()); return 1; } |