ZLIB
Loading...
Searching...
No Matches
zlib.h
Go to the documentation of this file.
1
67#ifndef ZLIB_H
68#define ZLIB_H
69
70#include "zconf.h"
71
72#ifdef __cplusplus
73extern "C" {
74#endif
75
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
86
87
98typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size);
99typedef void (*free_func)(voidpf opaque, voidpf address);
101
102struct internal_state;
103
136typedef struct z_stream_s {
137 const Bytef *next_in;
138 uInt avail_in;
139 uLong total_in;
140
141 Bytef *next_out;
143 uLong total_out;
144
145 const char *msg;
146 struct internal_state *state;
147
148 alloc_func zalloc;
149 free_func zfree;
150 voidpf opaque;
151
154 uLong adler;
155 uLong reserved;
156} z_stream;
157
158typedef z_stream *z_streamp;
159
164typedef struct gz_header_s {
165 int text;
166 uLong time;
167 int xflags;
168 int os;
169 Bytef *extra;
172 Bytef *name;
173 uInt name_max;
174 Bytef *comment;
175 uInt comm_max;
176 int hcrc;
177 int done;
179} gz_header;
180
181typedef gz_header *gz_headerp;
182
183
184 /* constants */
185
191#define Z_NO_FLUSH 0
192#define Z_PARTIAL_FLUSH 1
193#define Z_SYNC_FLUSH 2
194#define Z_FULL_FLUSH 3
195#define Z_FINISH 4
196#define Z_BLOCK 5
197#define Z_TREES 6
199
205#define Z_OK 0
206#define Z_STREAM_END 1
207#define Z_NEED_DICT 2
208#define Z_ERRNO (-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)
215
218#define Z_NO_COMPRESSION 0
219#define Z_BEST_SPEED 1
220#define Z_BEST_COMPRESSION 9
221#define Z_DEFAULT_COMPRESSION (-1)
223
226#define Z_FILTERED 1
227#define Z_HUFFMAN_ONLY 2
228#define Z_RLE 3
229#define Z_FIXED 4
230#define Z_DEFAULT_STRATEGY 0
232
235#define Z_BINARY 0
236#define Z_TEXT 1
237#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
238#define Z_UNKNOWN 2
240
242#define Z_DEFLATED 8
243
245#define Z_NULL 0
246
248#define zlib_version zlibVersion()
249
250
257const char* ZEXPORT zlibVersion (void);
258
259int ZEXPORT deflate(z_streamp strm, int flush);
260
261int ZEXPORT deflateEnd(z_streamp strm);
262
263int ZEXPORT inflate(z_streamp strm, int flush);
264
265int ZEXPORT inflateEnd(z_streamp strm);
267
275int ZEXPORT deflateSetDictionary(z_streamp strm,
276 const Bytef *dictionary,
277 uInt dictLength);
278
279int ZEXPORT deflateGetDictionary(z_streamp strm,
280 Bytef *dictionary,
281 uInt *dictLength);
282
283int ZEXPORT deflateCopy(z_streamp dest,
284 z_streamp source);
285
286int ZEXPORT deflateReset(z_streamp strm);
287
288int ZEXPORT deflateParams(z_streamp strm,
289 int level,
290 int strategy);
291
292int ZEXPORT deflateTune(z_streamp strm,
293 int good_length,
294 int max_lazy,
295 int nice_length,
296 int max_chain);
297
298uLong ZEXPORT deflateBound(z_streamp strm,
299 uLong sourceLen);
300
301int ZEXPORT deflatePending(z_streamp strm,
302 unsigned *pending,
303 int *bits);
304
305int ZEXPORT deflatePrime(z_streamp strm,
306 int bits,
307 int value);
308
309int ZEXPORT deflateSetHeader(z_streamp strm,
310 gz_headerp head);
311
312int ZEXPORT inflateSetDictionary(z_streamp strm,
313 const Bytef *dictionary,
314 uInt dictLength);
315
316int ZEXPORT inflateGetDictionary(z_streamp strm,
317 Bytef *dictionary,
318 uInt *dictLength);
319
320int ZEXPORT inflateSync(z_streamp strm);
321
322ZEXTERN int ZEXPORT inflateCopy(z_streamp dest,
323 z_streamp source);
324
325int ZEXPORT inflateReset(z_streamp strm);
326
327int ZEXPORT inflateReset2(z_streamp strm,
328 int windowBits);
329
330int ZEXPORT inflatePrime(z_streamp strm,
331 int bits,
332 int value);
333
334long ZEXPORT inflateMark(z_streamp strm);
335
336int ZEXPORT inflateGetHeader(z_streamp strm,
337 gz_headerp head);
338
340typedef unsigned (*in_func)(void*, const unsigned char* *);
341
343typedef int (*out_func)(void*, unsigned char *, unsigned);
344
345int ZEXPORT inflateBack(z_streamp strm,
346 in_func in, void* in_desc,
347 out_func out, void* out_desc);
348
349int ZEXPORT inflateBackEnd(z_streamp strm);
350
351uLong ZEXPORT zlibCompileFlags(void);
353
354#ifndef Z_SOLO
355
367int ZEXPORT compress(Bytef *dest, uLongf *destLen,
368 const Bytef *source, uLong sourceLen);
369
370int ZEXPORT compress2(Bytef *dest, uLongf *destLen,
371 const Bytef *source, uLong sourceLen,
372 int level);
373
374uLong ZEXPORT compressBound(uLong sourceLen);
375
376int ZEXPORT uncompress(Bytef *dest, uLongf *destLen,
377 const Bytef *source, uLong sourceLen);
378
379int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen,
380 const Bytef *source, uLong *sourceLen);
381
383
403struct gzFile_s {
404 unsigned have;
405 unsigned char* next;
406 z_off64_t pos;
407};
408
409typedef struct gzFile_s *gzFile;
410
411gzFile ZEXPORT gzdopen(int fd, const char *mode);
412
413int ZEXPORT gzbuffer(gzFile file, unsigned size);
414
415int ZEXPORT gzsetparams(gzFile file, int level, int strategy);
416
417int ZEXPORT gzread(gzFile file, voidp buf, unsigned len);
418
419z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems,
420 gzFile file);
421
422int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len);
423
424z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size,
425 z_size_t nitems, gzFile file);
426
427int ZEXPORTVA gzprintf(gzFile file, const char *format, ...);
428
429int ZEXPORT gzputs(gzFile file, const char *s);
430
431char* ZEXPORT gzgets(gzFile file, char *buf, int len);
432
433int ZEXPORT gzputc(gzFile file, int c);
434
435int ZEXPORT gzgetc(gzFile file);
436
437int ZEXPORT gzungetc(int c, gzFile file);
438
439int ZEXPORT gzflush(gzFile file, int flush);
440
441int ZEXPORT gzrewind(gzFile file);
442
443int ZEXPORT gzeof(gzFile file);
444
445int ZEXPORT gzdirect(gzFile file);
446
447int ZEXPORT gzclose(gzFile file);
448
449int ZEXPORT gzclose_r(gzFile file);
450int ZEXPORT gzclose_w(gzFile file);
451
452const char * ZEXPORT gzerror(gzFile file, int *errnum);
453
454ZEXTERN void ZEXPORT gzclearerr(gzFile file);
456
457#endif /* !Z_SOLO */
458
459 /* checksum functions */
460
461/*
462 These functions are not related to compression but are exported
463 anyway because they might be useful in applications using the compression
464 library.
465*/
466
467uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len);
468uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf,
469 z_size_t len);
470
471uLong ZEXPORT crc32(uLong crc, const Bytef *buf, uInt len);
472
473uLong ZEXPORT crc32_z(uLong crc, const Bytef *buf,
474 z_size_t len);
475
476/*
477ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2);
478
479 Return the operator corresponding to length len2, to be used with
480 crc32_combine_op().
481*/
482
483ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op);
484
485
486 /* various hacks, don't look :) */
487
488/* deflateInit and inflateInit are macros to allow checking the zlib version
489 * and the compiler's view of z_stream:
490 */
491ZEXTERN int ZEXPORT deflateInit_(z_streamp strm, int level,
492 const char *version, int stream_size);
493
494
495int ZEXPORT inflateInit_(z_streamp strm,
496 const char *version, int stream_size);
497
498int ZEXPORT deflateInit2_(z_streamp strm, int level, int method,
499 int windowBits, int memLevel,
500 int strategy, const char *version,
501 int stream_size);
502
503int ZEXPORT inflateInit2_(z_streamp strm, int windowBits,
504 const char *version, int stream_size);
505
506
507int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits,
508 unsigned char* window,
509 const char *version,
510 int stream_size);
511#ifdef Z_PREFIX_SET
512# define z_deflateInit(strm, level) \
513 deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
514
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))
521
523# define z_inflateInit2(strm, windowBits) \
524 inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
525 (int)sizeof(z_stream))
526
528# define z_inflateBackInit(strm, windowBits, window) \
529 inflateBackInit_((strm), (windowBits), (window), \
530 ZLIB_VERSION, (int)sizeof(z_stream))
531#else
534# define deflateInit(strm, level) \
535 deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
536
539# define inflateInit(strm) \
540 inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
541
543# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
544 deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
545 (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
546
548# define inflateInit2(strm, windowBits) \
549 inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
550 (int)sizeof(z_stream))
551
553# define inflateBackInit(strm, windowBits, window) \
554 inflateBackInit_((strm), (windowBits), (window), \
555 ZLIB_VERSION, (int)sizeof(z_stream))
556#endif
557
558#ifndef Z_SOLO
559
560/* gzgetc() macro and its supporting function and exposed data structure. */
561
562ZEXTERN int ZEXPORT gzgetc_(gzFile file); /* backward compatibility */
563#ifdef Z_PREFIX_SET
564# undef z_gzgetc
565# define z_gzgetc(g) \
566 ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
567#else
568# define gzgetc(g) \
569 ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
570#endif
571
572/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
573 * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
574 * both are true, the application gets the *64 functions, and the regular
575 * functions are changed to 64 bits) -- in case these are set on systems
576 * without large file support, _LFS64_LARGEFILE must also be true
577 */
578#ifdef Z_LARGE64
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);
582 ZEXTERN z_off64_t ZEXPORT gzoffset64(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);
586#endif
587
588#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
589# ifdef Z_PREFIX_SET
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
597# else
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
605# endif
606# ifndef Z_LARGE64
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);
610 ZEXTERN z_off_t ZEXPORT gzoffset64(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);
614# endif
615#else
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);
619 z_off_t ZEXPORT gzoffset(gzFile);
620 ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t);
621 ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t);
622 ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t);
623#endif
624
625#else /* Z_SOLO */
626
627 ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t);
628 ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t);
629 ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t);
630
631#endif /* !Z_SOLO */
632
633/* undocumented functions */
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,
644 const char *mode);
645#endif
646#if defined(STDC) || defined(Z_HAVE_STDARG_H)
647# ifndef Z_SOLO
648ZEXTERN int ZEXPORTVA gzvprintf(gzFile file,
649 const char *format,
650 va_list va);
651# endif
652#endif
653
654#ifdef __cplusplus
655}
656#endif
657
658#endif /* ZLIB_H */
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
gzip header information passed to and from zlib routines.
Definition zlib.h:164
int done
true when done reading gzip header (not used when writing a gzip file)
Definition zlib.h:177
int text
true if compressed data believed to be text
Definition zlib.h:165
int os
operating system
Definition zlib.h:168
Bytef * comment
pointer to zero-terminated comment or Z_NULL
Definition zlib.h:174
uInt extra_max
space at extra (only when reading header)
Definition zlib.h:171
int hcrc
true if there was or will be a header crc
Definition zlib.h:176
Bytef * name
pointer to zero-terminated file name or Z_NULL
Definition zlib.h:172
uInt comm_max
space at comment (only when reading header)
Definition zlib.h:175
uInt extra_len
extra field length (valid if extra != Z_NULL)
Definition zlib.h:170
uInt name_max
space at name (only when reading header)
Definition zlib.h:173
Bytef * extra
pointer to extra field or Z_NULL if none
Definition zlib.h:169
uLong time
modification time
Definition zlib.h:166
int xflags
extra flags (not used when writing a gzip file)
Definition zlib.h:167
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