79#define ZLIB_VERSION "1.3.0.f-neacsum"
80#define ZLIB_VERNUM 0x130f
81#define ZLIB_VER_MAJOR 1
82#define ZLIB_VER_MINOR 3
83#define ZLIB_VER_REVISION 0
84#define ZLIB_VER_SUBREVISION f
98typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size);
99typedef void (*free_func)(voidpf opaque, voidpf address);
102struct internal_state;
136typedef struct z_stream_s {
164typedef struct gz_header_s {
192#define Z_PARTIAL_FLUSH 1
193#define Z_SYNC_FLUSH 2
194#define Z_FULL_FLUSH 3
206#define Z_STREAM_END 1
209#define Z_STREAM_ERROR (-2)
210#define Z_DATA_ERROR (-3)
211#define Z_MEM_ERROR (-4)
212#define Z_BUF_ERROR (-5)
213#define Z_VERSION_ERROR (-6)
218#define Z_NO_COMPRESSION 0
219#define Z_BEST_SPEED 1
220#define Z_BEST_COMPRESSION 9
221#define Z_DEFAULT_COMPRESSION (-1)
227#define Z_HUFFMAN_ONLY 2
230#define Z_DEFAULT_STRATEGY 0
237#define Z_ASCII Z_TEXT
248#define zlib_version zlibVersion()
276 const Bytef *dictionary,
313 const Bytef *dictionary,
340typedef unsigned (*
in_func)(
void*,
const unsigned char* *);
343typedef int (*
out_func)(
void*,
unsigned char *, unsigned);
367int ZEXPORT
compress(Bytef *dest, uLongf *destLen,
368 const Bytef *source, uLong sourceLen);
370int ZEXPORT
compress2(Bytef *dest, uLongf *destLen,
371 const Bytef *source, uLong sourceLen,
376int ZEXPORT
uncompress(Bytef *dest, uLongf *destLen,
377 const Bytef *source, uLong sourceLen);
379int ZEXPORT
uncompress2(Bytef *dest, uLongf *destLen,
380 const Bytef *source, uLong *sourceLen);
411gzFile ZEXPORT
gzdopen(
int fd,
const char *mode);
413int ZEXPORT
gzbuffer(gzFile file,
unsigned size);
415int ZEXPORT
gzsetparams(gzFile file,
int level,
int strategy);
417int ZEXPORT
gzread(gzFile file, voidp buf,
unsigned len);
419z_size_t ZEXPORT
gzfread(voidp buf, z_size_t size, z_size_t nitems,
422int ZEXPORT
gzwrite(gzFile file, voidpc buf,
unsigned len);
424z_size_t ZEXPORT
gzfwrite(voidpc buf, z_size_t size,
425 z_size_t nitems, gzFile file);
427int ZEXPORTVA gzprintf(gzFile file,
const char *format, ...);
429int ZEXPORT
gzputs(gzFile file,
const char *s);
431char* ZEXPORT
gzgets(gzFile file,
char *buf,
int len);
433int ZEXPORT
gzputc(gzFile file,
int c);
435int ZEXPORT gzgetc(gzFile file);
437int ZEXPORT
gzungetc(
int c, gzFile file);
439int ZEXPORT
gzflush(gzFile file,
int flush);
443int ZEXPORT
gzeof(gzFile file);
447int ZEXPORT
gzclose(gzFile file);
452const char * ZEXPORT
gzerror(gzFile file,
int *errnum);
467uLong ZEXPORT
adler32(uLong adler,
const Bytef *buf, uInt len);
468uLong ZEXPORT
adler32_z(uLong adler,
const Bytef *buf,
471uLong ZEXPORT crc32(uLong crc,
const Bytef *buf, uInt len);
473uLong ZEXPORT crc32_z(uLong crc,
const Bytef *buf,
492 const char *version,
int stream_size);
496 const char *version,
int stream_size);
499 int windowBits,
int memLevel,
500 int strategy,
const char *version,
504 const char *version,
int stream_size);
508 unsigned char* window,
512# define z_deflateInit(strm, level) \
513 deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
516# define z_inflateInit(strm) \
517 inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
518# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
519 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
520 (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
523# define z_inflateInit2(strm, windowBits) \
524 inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
525 (int)sizeof(z_stream))
528# define z_inflateBackInit(strm, windowBits, window) \
529 inflateBackInit_((strm), (windowBits), (window), \
530 ZLIB_VERSION, (int)sizeof(z_stream))
534# define deflateInit(strm, level) \
535 deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
539# define inflateInit(strm) \
540 inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
543# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
544 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
545 (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
548# define inflateInit2(strm, windowBits) \
549 inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
550 (int)sizeof(z_stream))
553# define inflateBackInit(strm, windowBits, window) \
554 inflateBackInit_((strm), (windowBits), (window), \
555 ZLIB_VERSION, (int)sizeof(z_stream))
562ZEXTERN
int ZEXPORT gzgetc_(gzFile file);
565# define z_gzgetc(g) \
566 ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
569 ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
579 ZEXTERN gzFile ZEXPORT gzopen64(
const char *,
const char *);
580 ZEXTERN z_off64_t ZEXPORT
gzseek64(gzFile, z_off64_t,
int);
581 ZEXTERN z_off64_t ZEXPORT
gztell64(gzFile);
583 ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t);
584 ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t);
585 ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t);
588#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
590# define z_gzopen z_gzopen64
591# define z_gzseek z_gzseek64
592# define z_gztell z_gztell64
593# define z_gzoffset z_gzoffset64
594# define z_adler32_combine z_adler32_combine64
595# define z_crc32_combine z_crc32_combine64
596# define z_crc32_combine_gen z_crc32_combine_gen64
598# define gzopen gzopen64
599# define gzseek gzseek64
600# define gztell gztell64
601# define gzoffset gzoffset64
602# define adler32_combine adler32_combine64
603# define crc32_combine crc32_combine64
604# define crc32_combine_gen crc32_combine_gen64
607 ZEXTERN gzFile ZEXPORT gzopen64(
const char *,
const char *);
608 ZEXTERN z_off_t ZEXPORT
gzseek64(gzFile, z_off_t,
int);
609 ZEXTERN z_off_t ZEXPORT
gztell64(gzFile);
611 ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t);
612 ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t);
613 ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t);
616 gzFile ZEXPORT
gzopen(
const char *,
const char *);
617 z_off_t ZEXPORT
gzseek(gzFile, z_off_t,
int);
618 z_off_t ZEXPORT
gztell(gzFile);
620 ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t);
622 ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t);
627 ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t);
629 ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t);
634ZEXTERN
const char * ZEXPORT
zError(
int);
635ZEXTERN
int ZEXPORT inflateSyncPoint(
z_streamp);
636ZEXTERN
const z_crc_t* ZEXPORT get_crc_table(
void);
637ZEXTERN
int ZEXPORT inflateUndermine(
z_streamp,
int);
638ZEXTERN
int ZEXPORT inflateValidate(
z_streamp,
int);
639ZEXTERN
unsigned long ZEXPORT inflateCodesUsed(
z_streamp);
640ZEXTERN
int ZEXPORT inflateResetKeep(
z_streamp);
641ZEXTERN
int ZEXPORT deflateResetKeep(
z_streamp);
642#if defined(_WIN32) && !defined(Z_SOLO)
643ZEXTERN gzFile ZEXPORT gzopen_w(
const wchar_t *path,
646#if defined(STDC) || defined(Z_HAVE_STDARG_H)
648ZEXTERN
int ZEXPORTVA gzvprintf(gzFile file,
int ZEXPORT deflateSetHeader(z_streamp strm, gz_headerp head)
Provides gzip header information for when a gzip stream is requested by deflateInit2().
Definition deflate.c:915
int ZEXPORT inflateSetDictionary(z_streamp strm, const Bytef *dictionary, uInt dictLength)
Initializes the decompression dictionary from the given uncompressed byte sequence.
Definition inflate.c:1585
ZEXTERN int ZEXPORT inflateCopy(z_streamp dest, z_streamp source)
Sets the destination stream as a complete copy of the source stream.
Definition inflate.c:1798
int ZEXPORT deflatePending(z_streamp strm, unsigned *pending, int *bits)
Returns the number of bytes and bits of output that have been generated, but not yet provided in the ...
Definition deflate.c:935
long ZEXPORT inflateMark(z_streamp strm)
This function returns two values, one in the lower 16 bits of the return value, and the other in the ...
Definition inflate.c:1898
int ZEXPORT inflateGetDictionary(z_streamp strm, Bytef *dictionary, uInt *dictLength)
Returns the sliding dictionary being maintained by inflate.
Definition inflate.c:1544
int ZEXPORT deflateCopy(z_streamp dest, z_streamp source)
Sets the destination stream as a complete copy of the source stream.
Definition deflate.c:1718
int ZEXPORT deflateSetDictionary(z_streamp strm, const Bytef *dictionary, uInt dictLength)
Initializes the compression dictionary from the given byte sequence without producing any compressed ...
Definition deflate.c:710
int ZEXPORT deflateReset(z_streamp strm)
This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate t...
Definition deflate.c:883
int ZEXPORT inflatePrime(z_streamp strm, int bits, int value)
This function inserts bits in the inflate input stream.
Definition inflate.c:349
int ZEXPORT deflateParams(z_streamp strm, int level, int strategy)
Dynamically update the compression level and compression strategy.
Definition deflate.c:1022
int ZEXPORT inflateBackEnd(z_streamp strm)
All memory allocated by inflateBackInit() is freed.
Definition infback.c:715
uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen)
Returns an upper bound on the compressed size after deflation of sourceLen bytes.
Definition deflate.c:1127
int ZEXPORT inflateBack(z_streamp strm, in_func in, void *in_desc, out_func out, void *out_desc)
Does a raw inflate with a single call using a call-back interface for input and output.
Definition infback.c:331
int ZEXPORT inflateGetHeader(z_streamp strm, gz_headerp head)
Requests that gzip header information be stored in the provided gz_header structure.
Definition inflate.c:1656
int ZEXPORT inflateSync(z_streamp strm)
Skips invalid compressed data until a possible full flush point (see above for the description of def...
Definition inflate.c:1719
int ZEXPORT deflateTune(z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain)
Fine tune deflate's internal compression parameters.
Definition deflate.c:1078
int ZEXPORT deflatePrime(z_streamp strm, int bits, int value)
Inserts bits in the deflate output stream.
Definition deflate.c:959
uLong ZEXPORT zlibCompileFlags(void)
Return flags indicating compile-time options.
Definition zutil.c:79
int ZEXPORT deflateGetDictionary(z_streamp strm, Bytef *dictionary, uInt *dictLength)
Returns the sliding dictionary being maintained by deflate.
Definition deflate.c:795
int(* out_func)(void *, unsigned char *, unsigned)
Output function used by inflateBack()
Definition zlib.h:343
int ZEXPORT inflateReset(z_streamp strm)
This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate t...
Definition inflate.c:154
int ZEXPORT deflateInit2_(z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)
Another version of deflateInit() with more compression options.
Definition deflate.c:495
unsigned(* in_func)(void *, const unsigned char **)
Input function used by inflateBack()
Definition zlib.h:340
int ZEXPORT inflateReset2(z_streamp strm, int windowBits)
This function is the same as inflateReset, but it also permits changing the wrap and window size requ...
Definition inflate.c:177
const char *ZEXPORT zlibVersion(void)
The application can compare zlibVersion and ZLIB_VERSION for consistency.
Definition zutil.c:34
int ZEXPORT inflate(z_streamp strm, int flush)
Decompresses as much data as possible, and stops when the input buffer becomes empty or the output bu...
Definition inflate.c:834
int ZEXPORT deflateEnd(z_streamp strm)
All dynamically allocated data structures for this stream are freed.
Definition deflate.c:1678
int ZEXPORT inflateEnd(z_streamp strm)
All dynamically allocated data structures for this stream are freed.
Definition inflate.c:1519
int ZEXPORT deflate(z_streamp strm, int flush)
Compresses as much data as possible, and stops when the input buffer becomes empty or the output buff...
Definition deflate.c:1352
int ZEXPORT gzungetc(int c, gzFile file)
Push c back onto the stream for file to be read as the first character on the next read.
Definition gzread.c:510
int ZEXPORT gzdirect(gzFile file)
Return true (1) if file is being copied directly while reading, or false (0) if file is a gzip stream...
Definition gzread.c:660
int ZEXPORT gzsetparams(gzFile file, int level, int strategy)
Dynamically update the compression level and strategy for file.
Definition gzwrite.c:621
int ZEXPORT gzread(gzFile file, voidp buf, unsigned len)
Read and decompress up to len uncompressed bytes from file into buf.
Definition gzread.c:378
int ZEXPORT gzputc(gzFile file, int c)
Compress and write c, converted to an unsigned char, into file.
Definition gzwrite.c:307
int ZEXPORT gzrewind(gzFile file)
Rewind file.
Definition gzlib.c:408
int ZEXPORT gzputs(gzFile file, const char *s)
Compress and write the given null-terminated string s to file, excluding the terminating null charact...
Definition gzwrite.c:357
int ZEXPORT gzflush(gzFile file, int flush)
Flush all pending output to file.
Definition gzwrite.c:583
int ZEXPORT gzclose_w(gzFile file)
Same as gzclose(), but gzclose_r() is only for use when reading, and gzclose_w() is only for use when...
Definition gzwrite.c:668
int ZEXPORT gzclose_r(gzFile file)
Same as gzclose(), but gzclose_r() is only for use when reading, and gzclose_w() is only for use when...
Definition gzread.c:687
int ZEXPORT gzeof(gzFile file)
Return true (1) if the end-of-file indicator for file has been set while reading, false (0) otherwise...
Definition gzlib.c:640
ZEXTERN void ZEXPORT gzclearerr(gzFile file)
Clear the error and end-of-file flags for file.
Definition gzlib.c:694
char *ZEXPORT gzgets(gzFile file, char *buf, int len)
Read and decompress bytes from file into buf, until len-1 characters are read, or until a newline cha...
Definition gzread.c:582
gzFile ZEXPORT gzdopen(int fd, const char *mode)
Associate a gzFile with the file descriptor fd.
Definition gzlib.c:337
int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len)
Compress and write the len uncompressed bytes at buf to file.
Definition gzwrite.c:243
const char *ZEXPORT gzerror(gzFile file, int *errnum)
Return the error message for the last error which occurred on file.
Definition gzlib.c:670
int ZEXPORT gzclose(gzFile file)
Flush all pending output for file, if necessary, close file and deallocate the (de)compression state.
Definition gzclose.c:27
z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size, z_size_t nitems, gzFile file)
Compress and write nitems items of size size from buf to file, duplicating the interface of stdio's f...
Definition gzwrite.c:277
z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems, gzFile file)
Read and decompress up to nitems items of size size from file into buf, otherwise operating as gzread...
Definition gzread.c:432
int ZEXPORT gzbuffer(gzFile file, unsigned size)
Set the internal buffer size used by this library's functions for file to size.
Definition gzlib.c:377
uLong ZEXPORT compressBound(uLong sourceLen)
Returns an upper bound on the compressed size after compress() or compress2() on sourceLen bytes.
Definition compress.c:94
int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
Decompresses the source buffer into the destination buffer.
Definition uncompr.c:107
int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source, uLong *sourceLen)
Same as uncompress, except that sourceLen is a pointer, where the length of the source is *sourceLen.
Definition uncompr.c:34
int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level)
Compresses the source buffer into the destination buffer.
Definition compress.c:27
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)
Compresses the source buffer into the destination buffer.
Definition compress.c:79
ZEXTERN z_off64_t ZEXPORT gztell64(gzFile)
Return the starting position for the next gzread or gzwrite on file.
Definition gzlib.c:550
ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile)
Return the current compressed (actual) read or write offset of file.
Definition gzlib.c:589
ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int)
Set the starting position to offset relative to whence for the next gzread or gzwrite on file.
Definition gzlib.c:445
Semi-opaque gzip file descriptor structure.
Definition zlib.h:403
Compressed stream state information.
Definition zlib.h:136
uLong adler
Adler-32 or CRC-32 value of the uncompressed data.
Definition zlib.h:154
const Bytef * next_in
next input byte
Definition zlib.h:137
const char * msg
last error message, NULL if no error
Definition zlib.h:145
uLong total_out
total number of bytes output so far
Definition zlib.h:143
uLong total_in
total number of input bytes read so far
Definition zlib.h:139
alloc_func zalloc
used to allocate the internal state
Definition zlib.h:148
uInt avail_out
remaining free space at next_out
Definition zlib.h:142
Bytef * next_out
next output byte will go here
Definition zlib.h:141
int data_type
Definition zlib.h:152
uInt avail_in
number of bytes available at next_in
Definition zlib.h:138
uLong reserved
reserved for future use
Definition zlib.h:155
voidpf opaque
private data object passed to zalloc and zfree
Definition zlib.h:150
struct internal_state * state
not visible by applications
Definition zlib.h:146
free_func zfree
used to free the internal state
Definition zlib.h:149
z_off_t ZEXPORT gztell(gzFile)
Return the starting position for the next gzread or gzwrite on file.
Definition gzlib.c:573
ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t)
Combine two CRC-32 check values into one.
Definition crc32.c:1060
ZEXTERN int ZEXPORT deflateInit_(z_streamp strm, int level, const char *version, int stream_size)
Initializes the internal stream state for compression.
Definition deflate.c:399
z_off_t ZEXPORT gzseek(gzFile, z_off_t, int)
Set the starting position to offset relative to whence for the next gzread or gzwrite on file.
Definition gzlib.c:534
z_off_t ZEXPORT gzoffset(gzFile)
Return the current compressed (actual) read or write offset of file.
Definition gzlib.c:618
uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len)
Same as adler32(), but with a size_t length.
Definition adler32.c:67
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len)
Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum.
Definition adler32.c:153
gzFile ZEXPORT gzopen(const char *, const char *)
Open the gzip (.gz) file at path for reading and decompressing, or compressing and writing.
Definition gzlib.c:305
int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits, unsigned char *window, const char *version, int stream_size)
Initialize the internal stream state for decompression using inflateBack() calls.
Definition infback.c:47
int ZEXPORT inflateInit2_(z_streamp strm, int windowBits, const char *version, int stream_size)
This is another version of inflateInit with an extra parameter.
Definition inflate.c:266
ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op)
Give the same result as crc32_combine(), using op in place of len2.
Definition crc32.c:1084
int ZEXPORT inflateInit_(z_streamp strm, const char *version, int stream_size)
Initializes the internal stream state for decompression.
Definition inflate.c:327
ZEXTERN const char *ZEXPORT zError(int)
Exported to allow conversion of error code to string for compress() and uncompress()
Definition zutil.c:173