summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/LuaHandle.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/LuaHandle.cc b/lib/LuaHandle.cc
index ce6d48c..376e485 100644
--- a/lib/LuaHandle.cc
+++ b/lib/LuaHandle.cc
@@ -77,6 +77,7 @@ class sLuaHandle : public Base {
static int ucl_decompress(lua_State * L);
static int ucl_overlap(lua_State * L);
#endif
+ static int archive(lua_State * L);
private:
static int read(lua_State * L, int);
static int write(lua_State * L, int);
@@ -658,6 +659,19 @@ int sLuaHandle::ucl_overlap(lua_State * __L) {
}
#endif
+int sLuaHandle::archive(lua_State * __L) {
+ Lua * L = Lua::find(__L);
+ int n = L->gettop();
+
+ if ((n != 1) || !L->isstring(1)) {
+ L->error("Archive needs exactly one string argument.");
+ }
+
+ new Archive(L->tostring(1));
+
+ return 0;
+}
+
int sLuaHandle::seek(lua_State * __L) {
Lua * L = Lua::find(__L);
int n = L->gettop();
@@ -901,4 +915,6 @@ void LuaHandle::pushconstruct(Lua * L) {
L->declarefunc("ucl_decompress", sLuaHandle::ucl_decompress);
L->declarefunc("ucl_overlap", sLuaHandle::ucl_overlap);
#endif
+
+ L->declarefunc("Archive", sLuaHandle::archive);
}