00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00019
00020
00021 #include <zlib.h>
00022 #include <stdio.h>
00023 #include <string.h>
00024 #include <stdlib.h>
00025 #include<unistd.h>
00026
00027
00028 #ifdef USE_MMAP
00029 # include <sys/types.h>
00030 # include <sys/mman.h>
00031 # include <sys/stat.h>
00032 #endif
00033
00034
00035
00036 #ifndef GZ_SUFFIX
00037 # define GZ_SUFFIX ".gz" //extension of the compressed file
00038 #endif
00039
00040 #define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1)
00041
00042 #define BUFLEN 16384
00043 #define MAX_NAME_LEN 1024
00044
00045
00046
00055 void StringCompress();
00063 void Error OF((const char *msg));
00073 void GzCompress OF((FILE *in, gzFile out));
00084 #ifdef USE_MMAP
00085 int GzCompressMmap OF((FILE *in, gzFile out));
00086 #endif
00087
00094 void GzUnCompress OF((gzFile in, FILE *out));
00105 void FileCompress OF((char *file, char *mode));
00113 void FileUnCompress OF((char *file));