aboutsummaryrefslogtreecommitdiffstats
path: root/toj/center/src/pack.h
blob: 8f8ac8891b34bcc3454f2772f74398e9ff971590 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);