00001
00002
00003
00004
00005
00006
00007
00008 #ifndef ZLIB_H
00009 #define ZLIB_H
00010
00011 #include "zconf.h"
00012
00013 #ifdef __cplusplus
00014 extern "C" {
00015 #endif
00016
00017 #define ZLIB_VERSION "1.2.3"
00018 #define ZLIB_VERNUM 0x1230
00019
00020 typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
00021 typedef void (*free_func) OF((voidpf opaque, voidpf address));
00022
00023 struct internal_state;
00024
00025 typedef struct z_stream_s {
00026 Bytef *next_in;
00027 uInt avail_in;
00028 uLong total_in;
00029
00030 Bytef *next_out;
00031 uInt avail_out;
00032 uLong total_out;
00033
00034 char *msg;
00035 struct internal_state FAR *state;
00036
00037 alloc_func zalloc;
00038 free_func zfree;
00039 voidpf opaque;
00040
00041 int data_type;
00042 uLong adler;
00043 uLong reserved;
00044 } z_stream;
00045
00046 typedef z_stream FAR *z_streamp;
00047
00048 typedef struct gz_header_s {
00049 int text;
00050 uLong time;
00051 int xflags;
00052 int os;
00053 Bytef *extra;
00054 uInt extra_len;
00055 uInt extra_max;
00056 Bytef *name;
00057 uInt name_max;
00058 Bytef *comment;
00059 uInt comm_max;
00060 int hcrc;
00061 int done;
00062 } gz_header;
00063
00064 typedef gz_header FAR *gz_headerp;
00065
00066
00067
00068 #define Z_NO_FLUSH 0
00069 #define Z_PARTIAL_FLUSH 1
00070 #define Z_SYNC_FLUSH 2
00071 #define Z_FULL_FLUSH 3
00072 #define Z_FINISH 4
00073 #define Z_BLOCK 5
00074
00075 #define Z_OK 0
00076 #define Z_STREAM_END 1
00077 #define Z_NEED_DICT 2
00078 #define Z_ERRNO (-1)
00079 #define Z_STREAM_ERROR (-2)
00080 #define Z_DATA_ERROR (-3)
00081 #define Z_MEM_ERROR (-4)
00082 #define Z_BUF_ERROR (-5)
00083 #define Z_VERSION_ERROR (-6)
00084
00085 #define Z_NO_COMPRESSION 0
00086 #define Z_BEST_SPEED 1
00087 #define Z_BEST_COMPRESSION 9
00088 #define Z_DEFAULT_COMPRESSION (-1)
00089
00090 #define Z_FILTERED 1
00091 #define Z_HUFFMAN_ONLY 2
00092 #define Z_RLE 3
00093 #define Z_FIXED 4
00094 #define Z_DEFAULT_STRATEGY 0
00095
00096 #define Z_BINARY 0
00097 #define Z_TEXT 1
00098 #define Z_ASCII Z_TEXT
00099 #define Z_UNKNOWN 2
00100
00101 #define Z_DEFLATED 8
00102
00103 #define Z_NULL 0
00104
00105 #define zlib_version zlibVersion()
00106
00107
00108
00109 ZEXTERN const char * ZEXPORT zlibVersion OF((void));
00110
00111 ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
00112
00113 ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
00114
00115 ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
00116
00117 ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
00118
00119
00120
00121 ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
00122 const Bytef *dictionary,
00123 uInt dictLength));
00124
00125 ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
00126 z_streamp source));
00127
00128 ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
00129
00130 ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
00131 int level,
00132 int strategy));
00133
00134 ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
00135 int good_length,
00136 int max_lazy,
00137 int nice_length,
00138 int max_chain));
00139
00140 ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
00141 uLong sourceLen));
00142
00143 ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
00144 int bits,
00145 int value));
00146
00147 ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
00148 gz_headerp head));
00149
00150 ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
00151 const Bytef *dictionary,
00152 uInt dictLength));
00153
00154 ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
00155
00156 ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
00157 z_streamp source));
00158
00159 ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
00160
00161 ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
00162 int bits,
00163 int value));
00164
00165 ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
00166 gz_headerp head));
00167
00168 typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
00169 typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
00170
00171 ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
00172 in_func in, void FAR *in_desc,
00173 out_func out, void FAR *out_desc));
00174
00175 ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
00176
00177 ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
00178
00179
00180
00181 ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
00182 const Bytef *source, uLong sourceLen));
00183
00184 ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
00185 const Bytef *source, uLong sourceLen,
00186 int level));
00187
00188 ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
00189
00190 ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
00191 const Bytef *source, uLong sourceLen));
00192
00193 typedef voidp gzFile;
00194
00195 ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
00196
00197 ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
00198
00199 ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
00200
00201 ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
00202
00203 ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
00204 voidpc buf, unsigned len));
00205
00206 ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
00207
00208 ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
00209
00210 ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
00211
00212 ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
00213
00214 ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
00215
00216 ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
00217
00218 ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
00219
00220 ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
00221 z_off_t offset, int whence));
00222
00223 ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
00224
00225 ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
00226
00227 ZEXTERN int ZEXPORT gzeof OF((gzFile file));
00228
00229 ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
00230
00231 ZEXTERN int ZEXPORT gzclose OF((gzFile file));
00232
00233 ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
00234
00235 ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
00236
00237
00238
00239 ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
00240
00241 ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
00242 z_off_t len2));
00243
00244 ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
00245
00246 ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
00247
00248
00249
00250 ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
00251 const char *version, int stream_size));
00252 ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
00253 const char *version, int stream_size));
00254 ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
00255 int windowBits, int memLevel,
00256 int strategy, const char *version,
00257 int stream_size));
00258 ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
00259 const char *version, int stream_size));
00260 ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
00261 unsigned char FAR *window,
00262 const char *version,
00263 int stream_size));
00264 #define deflateInit(strm, level) \
00265 deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
00266 #define inflateInit(strm) \
00267 inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
00268 #define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
00269 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
00270 (strategy), ZLIB_VERSION, sizeof(z_stream))
00271 #define inflateInit2(strm, windowBits) \
00272 inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
00273 #define inflateBackInit(strm, windowBits, window) \
00274 inflateBackInit_((strm), (windowBits), (window), \
00275 ZLIB_VERSION, sizeof(z_stream))
00276
00277 #if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
00278 struct internal_state {int dummy;};
00279 #endif
00280
00281 ZEXTERN const char * ZEXPORT zError OF((int));
00282 ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
00283 ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
00284
00285 #ifdef __cplusplus
00286 }
00287 #endif
00288
00289 #endif