ZIP.h

Go to the documentation of this file.
00001 /* @(#)root/zip:$Id: ZIP.h 20882 2007-11-19 11:31:26Z rdm $ */
00002 /* Author: */
00003 /*
00004 
00005  Copyright (C) 1990-1993 Mark Adler, Richard B. Wales, Jean-loup Gailly,
00006  Kai Uwe Rommel and Igor Mandrichenko.
00007  For conditions of distribution and use, see copyright notice in zlib.h
00008 
00009 */
00010 
00011 /*
00012  *  zip.h by Mark Adler.
00013  */
00014 
00015 
00016 #define ZIP   /* for crypt.c:  include zip password functions, not unzip */
00017 
00018 /* Set up portability */
00019 /* #include "tailor.h" */
00020 #include "Tailor.h"
00021 
00022 #define MIN_MATCH  3
00023 #define MAX_MATCH  258
00024 /* The minimum and maximum match lengths */
00025 
00026 #ifndef WSIZE
00027 #  define WSIZE  ((unsigned)32768)
00028 #endif
00029 /* Maximum window size = 32K. If you are really short of memory, compile
00030  * with a smaller WSIZE but this reduces the compression ratio for files
00031  * of size > WSIZE. WSIZE must be a power of two in the current implementation.
00032  */
00033 
00034 #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
00035 /* Minimum amount of lookahead, except at the end of the input file.
00036  * See deflate.c for comments about the MIN_MATCH+1.
00037  */
00038 
00039 #define MAX_DIST  (WSIZE-MIN_LOOKAHEAD)
00040 /* In order to simplify the code, particularly on 16 bit machines, match
00041  * distances are limited to MAX_DIST instead of WSIZE.
00042  */
00043 
00044 
00045 /* Define fseek() commands */
00046 #ifndef SEEK_SET
00047 #  define SEEK_SET 0
00048 #endif /* !SEEK_SET */
00049 
00050 #ifndef SEEK_CUR
00051 #  define SEEK_CUR 1
00052 #endif /* !SEEK_CUR */
00053 
00054 /* Types centralized here for easy modification */
00055 #define local static            /* More meaningful outside functions */
00056 typedef unsigned char uch;      /* unsigned 8-bit value */
00057 typedef unsigned short ush;     /* unsigned 16-bit value */
00058 typedef unsigned long ulg;      /* unsigned 32-bit value */
00059 
00060 /* internal file attribute */
00061 #define UNKNOWN (-1)
00062 #define BINARY  0
00063 #define ASCII   1
00064 
00065 #define BEST -1                 /* Use best method (deflation or store) */
00066 #define STORE 0                 /* Store method */
00067 #define DEFLATE 8               /* Deflation method*/
00068 
00069 static int verbose=0;           /* Report oddities in zip file structure */
00070 static int level=6;             /* Compression level */
00071 
00072 /* Diagnostic functions */
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         /* in deflate.c */
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         /* in trees.c */
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         /* in bits.c */
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 /* !UTIL */
00118 
00119 /* end of zip.h */
00120 

Generated on Tue Jul 5 14:12:05 2011 for ROOT_528-00b_version by  doxygen 1.5.1