summaryrefslogtreecommitdiff
path: root/lib/LuaHandle.cc
diff options
context:
space:
mode:
authorpixel <pixel>2008-01-21 17:55:43 +0000
committerpixel <pixel>2008-01-21 17:55:43 +0000
commitb0f465417a0b64053a00b3353cc7b03eca3c444d (patch)
tree8f18201724abf633b56d63081467552a56b663fa /lib/LuaHandle.cc
parent18a3133823522b7d0454b59e48e9c066f5d15d1e (diff)
Adding even more debug stats.
Diffstat (limited to 'lib/LuaHandle.cc')
-rw-r--r--lib/LuaHandle.cc32
1 files changed, 31 insertions, 1 deletions
diff --git a/lib/LuaHandle.cc b/lib/LuaHandle.cc
index a1e5ccb..7ff7143 100644
--- a/lib/LuaHandle.cc
+++ b/lib/LuaHandle.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: LuaHandle.cc,v 1.23 2008-01-21 17:19:07 pixel Exp $ */
+/* $Id: LuaHandle.cc,v 1.24 2008-01-21 17:55:43 pixel Exp $ */
#include "LuaHandle.h"
@@ -64,6 +64,9 @@ class sLuaHandle : public Base {
static int btell(lua_State * L);
static int exists(lua_State * L);
static int get_nb_handles(lua_State * L);
+ static int get_nb_input(lua_State * L);
+ static int get_nb_output(lua_State * L);
+ static int get_nb_buffer(lua_State * L);
private:
static int read(lua_State * L, int);
static int write(lua_State * L, int);
@@ -489,6 +492,30 @@ int sLuaHandle::get_nb_handles(lua_State * __L) {
return 1;
}
+int sLuaHandle::get_nb_input(lua_State * __L) {
+ Lua * L = Lua::find(__L);
+
+ L->push((lua_Number) Input::GetNbInput());
+
+ return 1;
+}
+
+int sLuaHandle::get_nb_output(lua_State * __L) {
+ Lua * L = Lua::find(__L);
+
+ L->push((lua_Number) Output::GetNbOutput());
+
+ return 1;
+}
+
+int sLuaHandle::get_nb_buffer(lua_State * __L) {
+ Lua * L = Lua::find(__L);
+
+ L->push((lua_Number) Buffer::GetNbBuffer());
+
+ return 1;
+}
+
int sLuaHandle::seek(lua_State * __L) {
Lua * L = Lua::find(__L);
int n = L->gettop();
@@ -702,4 +729,7 @@ void LuaHandle::pushconstruct(Lua * L) {
L->settable(LUA_GLOBALSINDEX);
L->declarefunc("get_nb_handles", sLuaHandle::get_nb_handles);
+ L->declarefunc("get_nb_input", sLuaHandle::get_nb_input);
+ L->declarefunc("get_nb_output", sLuaHandle::get_nb_output);
+ L->declarefunc("get_nb_buffer", sLuaHandle::get_nb_buffer);
}