diff options
author | pzread <netfirewall@gmail.com> | 2013-03-01 22:30:00 +0800 |
---|---|---|
committer | pzread <netfirewall@gmail.com> | 2013-03-01 22:30:00 +0800 |
commit | 56688ed6d0b18f68ac8ddd82c4944c5d2777d20a (patch) | |
tree | bb943e164f82b4a826f1d9ce253bfabf912c0004 /toj/center/src/pack.h | |
parent | 69d7b55a1c9d3100d42b9c91ab995de44b13d73b (diff) | |
download | taiwan-online-judge-56688ed6d0b18f68ac8ddd82c4944c5d2777d20a.tar taiwan-online-judge-56688ed6d0b18f68ac8ddd82c4944c5d2777d20a.tar.gz taiwan-online-judge-56688ed6d0b18f68ac8ddd82c4944c5d2777d20a.tar.bz2 taiwan-online-judge-56688ed6d0b18f68ac8ddd82c4944c5d2777d20a.tar.lz taiwan-online-judge-56688ed6d0b18f68ac8ddd82c4944c5d2777d20a.tar.xz taiwan-online-judge-56688ed6d0b18f68ac8ddd82c4944c5d2777d20a.tar.zst taiwan-online-judge-56688ed6d0b18f68ac8ddd82c4944c5d2777d20a.zip |
Taiwan Online Judge Alpha 1
Diffstat (limited to 'toj/center/src/pack.h')
-rw-r--r-- | toj/center/src/pack.h | 20 |
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); |