summaryrefslogtreecommitdiff
path: root/lib/LuaHandle.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/LuaHandle.cc')
-rw-r--r--lib/LuaHandle.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/LuaHandle.cc b/lib/LuaHandle.cc
index 329c7e7..ce6d48c 100644
--- a/lib/LuaHandle.cc
+++ b/lib/LuaHandle.cc
@@ -75,6 +75,7 @@ class sLuaHandle : public Base {
#ifdef HAVE_UCL
static int ucl_compress(lua_State * L);
static int ucl_decompress(lua_State * L);
+ static int ucl_overlap(lua_State * L);
#endif
private:
static int read(lua_State * L, int);
@@ -632,6 +633,29 @@ int sLuaHandle::ucl_decompress(lua_State * __L) {
return 1;
}
+
+int sLuaHandle::ucl_overlap(lua_State * __L) {
+ Lua * L = Lua::find(__L);
+ int n = L->gettop();
+ Handle * s, * d;
+ int r, l, l_in = -1;
+
+ if (!((n >= 2) && (n <= 3)) || (!L->isnumber(2))) {
+ L->error("Incorrect arguments to method `Handle::ucl_overlap'");
+ }
+
+ s = L->recast<Handle>(1);
+ l = L->tonumber(2);
+ if (n == 3) {
+ l_in = L->tonumber(3);
+ }
+
+ r = Handle::ucl_overlap(s, l, l_in);
+
+ L->push((lua_Number) r);
+
+ return 1;
+}
#endif
int sLuaHandle::seek(lua_State * __L) {
@@ -875,5 +899,6 @@ void LuaHandle::pushconstruct(Lua * L) {
#ifdef HAVE_UCL
L->declarefunc("ucl_compress", sLuaHandle::ucl_compress);
L->declarefunc("ucl_decompress", sLuaHandle::ucl_decompress);
+ L->declarefunc("ucl_overlap", sLuaHandle::ucl_overlap);
#endif
}