summaryrefslogtreecommitdiff
path: root/lib/LuaHandle.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/LuaHandle.cc')
-rw-r--r--lib/LuaHandle.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/LuaHandle.cc b/lib/LuaHandle.cc
index ba66afc..4b6fd6e 100644
--- a/lib/LuaHandle.cc
+++ b/lib/LuaHandle.cc
@@ -78,6 +78,7 @@ class sLuaHandle : public Base {
static int bseek(lua_State * L);
static int btell(lua_State * L);
static int breset(lua_State * L);
+ static int setfakename(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);
@@ -1090,6 +1091,20 @@ int sLuaHandle::breset(lua_State * __L) {
return 0;
}
+int sLuaHandle::setfakename(lua_State * __L) {
+ Lua * L = Lua::find(__L);
+ int n = L->gettop();
+ Buffer * h;
+
+ if ((n != 2) || !L->isstring(2)) {
+ L->error("Incorrect arguments to method `Buffer::setfakename'");
+ }
+
+ h = L->recast<Buffer>();
+ h->setfakename(L->tostring(2));
+ return 0;
+}
+
int sLuaHandle::exists(lua_State * __L) {
Lua * L = Lua::find(__L);
int n = L->gettop();
@@ -1132,6 +1147,7 @@ void LuaBuffer::pushmembers(Lua * L) {
pushit(L, "wtell", sLuaHandle::btell);
pushit(L, "wseek", sLuaHandle::bseek);
pushit(L, "reset", sLuaHandle::breset);
+ pushit(L, "setfakename", sLuaHandle::setfakename);
L->push("__handletype");
L->push("Buffer");
L->settable(-3, true);