Lines Matching refs:OF
1 /* zlib.h -- interface of the 'zlib' general purpose compression library
8 arising from the use of this software.
14 1. The origin of this software must not be misrepresented; you must not
49 decompression functions, including integrity checks of the uncompressed data.
50 This version of the library supports only one compression method (deflation)
55 or can be done by repeated calls of the compression function. In the latter
64 with an interface similar to that of stdio using the functions that start
76 the consistency of the compressed data, so the library should never crash
77 even in case of corrupted input.
80 typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
81 typedef void (*free_func) OF((voidpf opaque, voidpf address));
87 uInt avail_in; /* number of bytes available at next_in */
88 uLong total_in; /* total nb of input bytes read so far */
92 uLong total_out; /* total nb of bytes output so far */
102 uLong adler; /* adler32 value of the uncompressed data */
110 for more details on the meanings of these fields.
139 parameter for calls of zalloc and zfree. This can be useful for custom
150 returned by zalloc for objects of exactly 65536 bytes *must* have their
153 any allocation of 64K objects, at the expense of compression ratio, compile
157 reports. After compression, total_in holds the total size of the
203 /* Possible values of the data_type field (though see inflate()) */
216 ZEXTERN const char * ZEXPORT zlibVersion OF((void));
224 ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
246 ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
253 The detailed semantics are as follows. deflate performs one or both of the
259 processing will resume at this point for the next call of deflate().
267 Before the call of deflate(), the application should ensure that at least
268 one of the actions is possible, by providing more input and/or consuming more
272 == 0), or after each call of deflate(). If deflate returns Z_OK and with
291 output buffer, but the output is not aligned to a byte boundary. All of the
300 seven bits of the current block are held to be written as the next byte after
302 be provided enough bits at this point in order to complete decompression of
305 the emission of deflate blocks.
314 with the same value of the flush parameter and more output space (updated
316 avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
333 deflate() sets strm->adler to the adler32 checksum of all input read
352 ZEXTERN int ZEXPORT deflateEnd OF
367 ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
374 accordingly; otherwise the allocation will be deferred to the first call of
386 of inflateInit() does not process any header information -- that is deferred
391 ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
398 The detailed semantics are as follows. inflate performs one or both of the
404 resume at this point for the next call of inflate().
411 Before the call of inflate(), the application should ensure that at least
412 one of the actions is possible, by providing more input and/or consuming more
415 when the output buffer is full (avail_out == 0), or after each call of
420 The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
427 gets to the end of that block, or when it runs out of data.
431 number of unused bits in the last byte taken from strm->next_in, plus 64 if
433 128 if inflate() returned immediately after decoding an end-of-block code or
434 decoding the complete header up to just before the first byte of the deflate
435 stream. The end-of-block will not be indicated until all of the uncompressed
436 data from that block has been written to strm->next_out. The number of
437 unused bits may in general be greater than seven, except when bit 7 of
438 data_type is set, in which case the number of unused bits will be less than
440 flush options, and so can be used to determine the amount of currently
444 end of each deflate block header is reached, before any actual data in that
445 block is decoded. This allows the caller to determine the length of the
447 256 is added to the value of strm->data_type when inflate() returns
448 immediately after reaching the end of the deflate block header.
452 single call of inflate), the parameter flush should be set to Z_FINISH. In
455 of the uncompressed data may have been saved by the compressor for this
457 the decompression state. The use of Z_FINISH is never required, but can be
463 first call. So the only effect of the flush parameter in this implementation
464 is on the return value of inflate(), as noted below, or when it returns early
468 below), inflate sets strm->adler to the adler32 checksum of the dictionary
470 strm->adler to the adler32 checksum of all output produced so far (that is,
472 below. At the end of the stream, inflate() checks that its computed adler32
481 perform their own processing of the gzip header and trailer.
484 or more output produced), Z_STREAM_END if the end of the compressed data has
495 recovery of the data is desired.
499 ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
518 ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
525 This is another version of deflateInit with more compression options. The
530 this version of the library.
532 The windowBits parameter is the base two logarithm of the window size
533 (the size of the history buffer). It should be in the range 8..15 for this
534 version of the library. Larger values of this parameter result in better
535 compression at the expense of memory usage. The default value is 15 if
544 compressed data instead of a zlib wrapper. The gzip header will have no
547 gzip stream is being written, strm->adler is a crc32 instead of an adler32.
553 as a function of windowBits and memLevel.
559 encoding). Filtered data consists mostly of small values with a somewhat
561 compress them better. The effect of Z_FILTERED is to force more Huffman
566 correctness of the compressed output even if it is not set appropriately.
567 Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
578 ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
585 of deflate. The compressor and decompressor must use exactly the same
588 The dictionary should consist of strings (byte sequences) that are likely
590 used strings preferably put towards the end of the dictionary. Using a
595 Depending on the size of the compression data structures selected by
596 deflateInit or deflateInit2, a part of the dictionary may in effect be
599 useful should be put at the end of the dictionary, not at the front. In
600 addition, the current implementation of deflate will use at most the window
601 size minus 262 bytes of the provided dictionary.
603 Upon return of this function, strm->adler is set to the adler32 value
604 of the dictionary; the decompressor may later use this value to determine
606 applies to the whole dictionary even if only a subset of the dictionary is
617 ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
620 Sets the destination stream as a complete copy of the source stream.
623 tried, for example when there are several ways of pre-processing the input
627 consume lots of memory.
635 ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
646 ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
651 interpretation of
652 used to switch between compression and straight copy of the input data, or
653 to switch to a different kind of input data requiring a different strategy.
656 effect only at the next call of deflate().
658 Before the call of deflateParams, the stream state must be set as for
659 a call of deflate(), since the currently available input may have to be
667 ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
677 specific input data. Read the deflate.c source code for the meaning of the
684 ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
688 deflation of sourceLen bytes. It must be called after deflateInit() or
694 ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
703 than or equal to 16, and that many of the least significant bits of value
710 ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
715 after deflateInit2() or deflateReset() and before the first call of
722 the current versions of the command-line version of gzip (up through version
735 ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
738 This is another version of inflateInit with an extra parameter. The
742 The windowBits parameter is the base two logarithm of the maximum window
743 size (the size of the history buffer). It should be in the range 8..15 for
744 this version of the library. The default value is 15 if inflateInit is used
749 Z_DATA_ERROR instead of trying to allocate a larger window.
752 the zlib header of the compressed stream.
757 looking for any check values for comparison at the end of the stream. This
764 above on the use in deflateInit2() applies to the magnitude of windowBits.
770 crc32 instead of an adler32.
780 of inflateInit2() does not process any header information -- that is
784 ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
789 sequence. This function must be called immediately after a call of inflate,
791 can be determined from the adler32 value returned by that call of inflate.
794 immediately after inflateInit2() or inflateReset() and before any call of
802 perform any decompression: this will be done by subsequent calls of
806 ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
809 description of deflate with Z_FULL_FLUSH) can be found, or until all
815 success case, the application may save the current current value of total_in
818 time, until success or end of the input data.
821 ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
824 Sets the destination stream as a complete copy of the source stream.
837 ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
847 ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
859 ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
865 middle of a byte. The provided bits will be used before any bytes are used
868 inflateReset(). bits must be less than or equal to 16, and that many of the
869 least significant bits of value will be inserted in the input.
880 ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
882 This function returns two values, one in the lower 16 bits of the return
885 zero, then inflate() is currently decoding information outside of a block.
887 the middle of a stored block, with the lower value equaling the number of
889 it is the number of bits back from the current bit position in the input of
891 that case the lower value is the number of bytes already emitted for that
895 decoding of the code, or if it has completed decoding but is waiting for
900 output of a code may span boundaries of random access blocks. The current
908 ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
913 inflateInit2() or inflateReset(), and before the first call of inflate().
924 contains the maximum number of bytes to write to extra. Once done is true,
931 of extra, name, or comment are not Z_NULL and the respective field is not
933 absence. This allows the use of deflateSetHeader() with the returned
949 ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
956 of the window size, in the range 8..15. window is a caller
957 supplied buffer of that size. Except for special applications where it is
962 See inflateBack() for the usage of these routines.
964 inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
966 allocated, or Z_VERSION_ERROR if the version of the library does not match
967 the version of the header file.
970 typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
971 typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
973 ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
995 behavior of inflate(), which expects either a zlib or gzip header and
1000 routines until it reads a complete deflate stream and writes out all of the
1004 number of bytes of provided input, and a pointer to that input in buf. If
1010 are permitted to change the contents of the window provided to
1013 amount of input may be provided by in().
1023 The in_desc and out_desc parameters of inflateBack() is passed as the
1024 first parameter of in() and out() respectively when they are called. These
1030 return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
1033 of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
1034 In the case of Z_BUF_ERROR, an input or output error can be distinguished
1042 ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
1050 ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
1054 1.0: size of uInt
1055 3.2: size of uLong
1056 5.4: size of voidpf (pointer)
1057 7.6: size of z_off_t
1095 The following utility functions are implemented on top of the basic
1098 functions). The source code of these utility functions can be modified if
1102 ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
1106 the byte length of the source buffer. Upon entry, destLen is the total size
1107 of the destination buffer, which must be at least the value returned by
1108 compressBound(sourceLen). Upon exit, destLen is the actual size of the
1116 ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
1122 length of the source buffer. Upon entry, destLen is the total size of the
1124 compressBound(sourceLen). Upon exit, destLen is the actual size of the
1132 ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
1139 ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
1143 the byte length of the source buffer. Upon entry, destLen is the total size
1144 of the destination buffer, which must be large enough to hold the entire
1145 uncompressed data. (The size of the uncompressed data must have been saved
1147 mechanism outside the scope of this compression library.) Upon exit, destLen
1148 is the actual size of the uncompressed buffer.
1160 an interface similar to that of stdio, using the functions that start with
1168 ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
1174 for fixed code compression as in "wb9F". (See the description of
1176 can be used instead of "w" to request that the gzip stream that will be
1190 ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
1196 The next call of gzclose on the returned gzFile will also close the file
1209 ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
1215 write. Two buffers are allocated, either both of the specified size when
1216 writing, or one of the specified size and the other twice that size when
1217 reading. A larger buffer size of, for example, 64K or 128K bytes will
1218 noticeably increase the speed of decompression (reading).
1226 ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
1229 of deflateInit2 for the meaning of these parameters.
1235 ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
1237 Reads the given number of uncompressed bytes from the compressed file. If
1238 the input file was not in gzip format, gzread copies the given number of
1241 After reaching the end of a gzip stream in the input, gzread will continue
1243 of the input file directly without decompression. The entire input file
1247 gzread returns the number of uncompressed bytes actually read, less than
1248 len for end of file, or -1 for error.
1251 ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
1254 Writes the given number of uncompressed bytes into the compressed file.
1255 gzwrite returns the number of uncompressed bytes written or 0 in case of
1259 ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
1262 control of the format string, as in fprintf. gzprintf returns the number of
1263 uncompressed bytes actually written, or 0 in case of error. The number of
1274 ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
1279 gzputs returns the number of characters written, or -1 in case of error.
1282 ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
1285 newline character is read and transferred to buf, or an end-of-file
1288 to an end-of
1291 for end-of-file or in case of error. If there was an error, the contents at
1295 ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
1298 returns the value that was written, or -1 in case of error.
1301 ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
1304 in case of end of file or error.
1307 ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
1310 on the next read. At least one character of push-back is allowed.
1314 output buffer size of pushed characters is allowed. (See gzbuffer above.)
1319 ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
1335 ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
1339 compressed file. The offset represents a number of bytes in the
1345 supported; gzseek then compresses a sequence of zeroes up to the new
1349 the beginning of the uncompressed stream, or -1 in case of error, in
1354 ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
1362 ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
1365 compressed file. This position represents a number of bytes in the
1367 reading a gzip stream from the middle of a file using gzdopen().
1373 ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
1376 includes the count of bytes that precede the gzip stream, for example when
1382 ZEXTERN int ZEXPORT gzeof OF((gzFile file));
1384 Returns true (1) if the end-of-file indicator has been set while reading,
1385 false (0) otherwise. Note that the end-of-file indicator is set only if the
1386 read tried to go past the end of the input, but came up short. Therefore,
1388 read, in the event that the last read request was for the exact number of
1390 is an exact multiple of the buffer size.
1393 unless the end-of-file indicator is reset by gzclearerr() and the input file
1394 has grown since the previous end of file was detected.
1397 ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
1401 false to true while reading the input file if the end of a gzip stream is
1413 ZEXTERN int ZEXPORT gzclose OF((gzFile file));
1425 ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
1426 ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
1430 using these instead of gzclose() is that they avoid linking in zlib
1437 ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
1449 gzerror() should be used to distinguish errors from end-of-file for those
1453 ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
1455 Clears the error and end-of-file flags for file. This is analogous to the
1469 ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
1489 ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
1492 Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
1494 each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
1498 ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
1517 ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
1519 Combine two CRC-32 check values into one. For two sequences of bytes,
1522 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
1530 * and the compiler's view of z_stream:
1532 ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
1534 ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
1536 ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
1540 ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
1542 ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
1566 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
1567 ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
1568 ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
1569 ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
1570 ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
1571 ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
1582 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
1583 ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
1584 ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
1585 ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
1586 ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
1587 ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
1590 ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
1591 ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
1592 ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
1593 ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
1594 ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
1595 ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
1604 ZEXTERN const char * ZEXPORT zError OF((int));
1605 ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
1606 ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
1607 ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));