00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #define ZIP
00017
00018
00019
00020 #include "Tailor.h"
00021
00022 #define MIN_MATCH 3
00023 #define MAX_MATCH 258
00024
00025
00026 #ifndef WSIZE
00027 # define WSIZE ((unsigned)32768)
00028 #endif
00029
00030
00031
00032
00033
00034 #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
00035
00036
00037
00038
00039 #define MAX_DIST (WSIZE-MIN_LOOKAHEAD)
00040
00041
00042
00043
00044
00045
00046 #ifndef SEEK_SET
00047 # define SEEK_SET 0
00048 #endif
00049
00050 #ifndef SEEK_CUR
00051 # define SEEK_CUR 1
00052 #endif
00053
00054
00055 #define local static
00056 typedef unsigned char uch;
00057 typedef unsigned short ush;
00058 typedef unsigned long ulg;
00059
00060
00061 #define UNKNOWN (-1)
00062 #define BINARY 0
00063 #define ASCII 1
00064
00065 #define BEST -1
00066 #define STORE 0
00067 #define DEFLATE 8
00068
00069 static int verbose=0;
00070 static int level=6;
00071
00072
00073 #ifdef DEBUG
00074 # ifdef MSDOS
00075 # undef stderr
00076 # define stderr stdout
00077 # endif
00078 # define diag(where) fprintf(stderr, "zip diagnostic: %s\n", where)
00079 # define Assert(cond,msg) {if(!(cond)) error(msg);}
00080 # define Trace(x) fprintf x
00081 # define Tracev(x) {if (verbose) fprintf x ;}
00082 # define Tracevv(x) {if (verbose>1) fprintf x ;}
00083 # define Tracec(c,x) {if (verbose && (c)) fprintf x ;}
00084 # define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}
00085 #else
00086 # define diag(where)
00087 # define Assert(cond,msg)
00088 # define Trace(x)
00089 # define Tracev(x)
00090 # define Tracevv(x)
00091 # define Tracec(c,x)
00092 # define Tracecv(c,x)
00093 #endif
00094
00095 #ifndef UTIL
00096
00097 void R__lm_init OF((int pack_level, ush *flags));
00098 void R__lm_free OF((void));
00099 ulg R__Deflate OF((void));
00100
00101
00102 void R__ct_init OF((ush *attr, int *method));
00103 int R__ct_tally OF((int dist, int lc));
00104 ulg R__flush_block OF((char far *buf, ulg stored_len, int eof));
00105
00106
00107 void R__bi_init OF((FILE *zipfile));
00108 void R__send_bits OF((int value, int length));
00109 unsigned R__bi_reverse OF((unsigned value, int length));
00110 void R__bi_windup OF((void));
00111 void R__copy_block OF((char far *buf, unsigned len, int header));
00112 int R__seekable OF((void));
00113 extern int (*R__read_buf) OF((char *buf, unsigned size));
00114 ulg R__memcompress OF((char *tgt, ulg tgtsize, char *src, ulg srcsize));
00115 void R__error OF((char *h));
00116
00117 #endif
00118
00119
00120