00001
00002 #ifndef __JBXL_GZPACKING_TOOL_H_
00003 #define __JBXL_GZPACKING_TOOL_H_
00004
00005
00013 #include "tools.h"
00014 #include "buffer.h"
00015
00016 #include <zlib.h>
00017
00018
00019 #ifdef WIN32
00020 #pragma comment(lib, "zdll.lib")
00021 #endif
00022
00023
00024 #define GZIP_DEFLATE_ID1 0x78
00025 #define GZIP_DEFLATE_ID2 0xda
00026
00027
00028
00029 Buffer gz_decode_data(Buffer enc);
00030 void deflate2gzip(Buffer* def);
00031
00032
00033
00034 int gz_decode_fp(FILE* infp, FILE* otfp);
00035
00036 int gz_encode_gzfp(FILE* fp, gzFile* gf);
00037 int gz_decode_gzfp(gzFile* gf, FILE* fp);
00038
00039 int gz_encode_file(const char* ffn, const char* tfn);
00040 int gz_decode_file(const char* ffn, const char* tfn);
00041 int gz_decode_file_replace(const char* fn, const char* dir);
00042
00043
00044 #endif