diff options
author | Pixel <pixel@nobis-crew.org> | 2009-11-13 17:56:08 -0800 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2009-11-13 17:56:08 -0800 |
commit | 882715383682541b79642fc0e731ad533e04162e (patch) | |
tree | 3ce8c1beca210e7ed65e36223759a2bb7d5288e8 /lib | |
parent | 9d155a9f9464cfb85bf864c8e0075743dc15a52a (diff) |
Speeding up a little bit the Lua class.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/BLua.cc | 191 |
1 files changed, 0 insertions, 191 deletions
diff --git a/lib/BLua.cc b/lib/BLua.cc index 57b9eb8..0a763aa 100644 --- a/lib/BLua.cc +++ b/lib/BLua.cc @@ -510,18 +510,6 @@ Lua::Lua(lua_State * __L) : L(__L), _protected(false), _is_thread(true) { } -void Lua::SetPrinter(LuaPrinter * lp) { - lprinter = lp; -} - -void Lua::puts(const char * msg) { - lprinter->puts(msg); -} - -Lua * Lua::Father() { - return father ? father : this; -} - Lua * Lua::spawn_from_thread(lua_State * __L) { Lua * L = new Lua(__L); L->father = Father(); @@ -552,10 +540,6 @@ Lua::~Lua() { L = 0; } -bool Lua::is_protected() { - return _protected; -} - Lua::Lua(const Lua & l) throw (GeneralException) { throw GeneralException("Error: can't duplicate a Lua object."); } @@ -636,10 +620,6 @@ void Lua::open_bit() { lua_pop(L, 1); } -int Lua::wrap_open(openlualib_t open) { - return open(L); -} - void Lua::declarefunc(const String & name, lua_CFunction f, int i) { lua_pushstring(L, name.to_charp()); lua_pushcfunction(L, f); @@ -679,22 +659,6 @@ void Lua::call(int nargs, int nresults) throw(GeneralException) { } } -void Lua::push() { - lua_pushnil(L); -} - -void Lua::push(lua_Number n) { - lua_pushnumber(L, n); -} - -void Lua::push(const String & s) { - lua_pushlstring(L, s.to_charp(), s.strlen()); -} - -void Lua::push(bool b) { - lua_pushboolean(L, b); -} - void Lua::push(const char * s, int size) { if (size < 0) { lua_pushstring(L, s); @@ -703,46 +667,6 @@ void Lua::push(const char * s, int size) { } } -void Lua::push(void * p) { - lua_pushlightuserdata(L, p); -} - -void Lua::push(lua_CFunction f, int n) { - lua_pushcclosure(L, f, n); -} - -void Lua::pop(int n) { - lua_pop(L, n); -} - -int Lua::next(int t) { - return lua_next(L, t); -} - -void Lua::copy(int n) { - lua_pushvalue(L, n); -} - -void Lua::remove(int n) { - lua_remove(L, n); -} - -void Lua::insert(int n) { - lua_insert(L, n); -} - -void Lua::replace(int n) { - lua_replace(L, n); -} - -void Lua::newtable() { - lua_newtable(L); -} - -void * Lua::newuser(size_t s) { - return lua_newuserdata(L, s); -} - void Lua::settable(int i, bool raw) { if (raw) { lua_rawset(L, i); @@ -759,14 +683,6 @@ void Lua::gettable(int i, bool raw) { } } -void Lua::setvar() { - lua_settable(L, LUA_GLOBALSINDEX); -} - -int Lua::gettop() { - return lua_gettop(L); -} - void Lua::getglobal(const String & name) throw (GeneralException) { Buffer b; b << "return " + name; @@ -806,50 +722,6 @@ void Lua::error(const String & msg) { lua_error(L); } -int Lua::status() { - return 0; -} - -int Lua::type(int i) { - return lua_type(L, i); -} - -bool Lua::isnil(int i) { - return lua_isnil(L, i); -} - -bool Lua::isboolean(int i) { - return lua_isboolean(L, i); -} - -bool Lua::isnumber(int i) { - return lua_isnumber(L, i); -} - -bool Lua::isstring(int i) { - return lua_isstring(L, i); -} - -bool Lua::istable(int i) { - return lua_istable(L, i); -} - -bool Lua::isfunction(int i) { - return lua_isfunction(L, i); -} - -bool Lua::iscfunction(int i) { - return lua_iscfunction(L, i); -} - -bool Lua::isuserdata(int i) { - return lua_isuserdata(L, i); -} - -bool Lua::islightuserdata(int i) { - return lua_islightuserdata(L, i); -} - bool Lua::isobject(int i) { bool r = false; if (istable(i)) { @@ -863,14 +735,6 @@ bool Lua::isobject(int i) { return r; } -bool Lua::toboolean(int i) { - return lua_toboolean(L, i); -} - -lua_Number Lua::tonumber(int i) { - return lua_tonumber(L, i); -} - String Lua::tostring(int i) { const char * r = 0; size_t l = -1; @@ -890,18 +754,6 @@ String Lua::tostring(int i) { return String(r ? r : "<lua-NULL>", l); } -lua_CFunction Lua::tocfunction(int i) { - return lua_tocfunction(L, i); -} - -void * Lua::touserdata(int i) { - return lua_touserdata(L, i); -} - -Lua * Lua::tothread(int i) { - return find(lua_tothread(L, i)); -} - struct LoadF { Handle * f; char buff[BUFFERSIZE]; @@ -1154,10 +1006,6 @@ Lua * Lua::thread(Handle * h, int nargs, bool saveit) { return L1; } -int Lua::yield(int nresults) { - return lua_yield(L, nresults); -} - bool Lua::resume(int nargs) throw (GeneralException) { int r; @@ -1263,41 +1111,6 @@ void Lua::showerror() { showstack(M_ERROR); } -int Lua::getmetatable(int i) { - return lua_getmetatable(L, i); -} - -int Lua::setmetatable(int i) { - return lua_setmetatable(L, i); -} - -int Lua::sethook(lua_Hook func, int mask, int count) { - return lua_sethook(L, func, mask, count); -} - -void Lua::do_break() { -// lua_break(L); -} - -void Lua::openlib(const String & libname, const luaL_reg *l, int nup) { - luaL_openlib(L, libname.to_charp(), l, nup); -} - -/* ***TODO*** handle the new garbage collection system. */ - -void Lua::setgcthreshold(int newthreshold) { -// lua_setgcthreshold(L, newthreshold); -} - -int Lua::getgcthreshold() { -// return lua_getgcthreshold(L); - return 0; -} - -int Lua::getgccount() { - return lua_getgccount(L); -} - void LuaObject::push(Lua * L) throw (GeneralException) { if (pushed && wantdestruct) { throw GeneralException("Error: object is owned by the LUA script and can not be pushed."); @@ -1372,7 +1185,3 @@ void LuaObject::pushdestruct(Lua * L) throw (GeneralException) { wantdestruct = true; } - -LuaException::LuaException(String fn) : GeneralException(fn) { } - -LuaException::LuaException() { } |