aboutsummaryrefslogtreecommitdiffstats
path: root/toj/center/src/pack.h
diff options
context:
space:
mode:
Diffstat (limited to 'toj/center/src/pack.h')
-rw-r--r--toj/center/src/pack.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/toj/center/src/pack.h b/toj/center/src/pack.h
new file mode 100644
index 0000000..8f8ac88
--- /dev/null
+++ b/toj/center/src/pack.h
@@ -0,0 +1,20 @@
+#define PACK_BUFSIZE 65536
+struct pack_bzinfo{
+ bz_stream bzs;
+ char buf[PACK_BUFSIZE];
+ int len;
+ int off;
+ bool endflag;
+};
+
+static int pack_copenfn(const char *pathname,int flags,...);
+static int pack_cclosefn(long fd);
+static ssize_t cpack_writefn(long fd,const void *buf,size_t count);
+static int pack_xopenfn(const char *pathname,int flags,...);
+static int pack_xclosefn(long fd);
+static ssize_t xpack_readfn(long fd,void *buf,size_t count);
+
+static std::map<int,pack_bzinfo*> pack_fdmap;
+
+int pack_pack(char *packpath,char *dirpath);
+int pack_unpack(char *packpath,char *dirpath);