Home | History | Annotate | Download | only in include

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
48 decompression functions, including integrity checks of the uncompressed
49 data. This version of the library supports only one compression method
55 repeated calls of the compression function. In the latter case, the
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
77 crash 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 pointers returned by zalloc for objects of exactly 65536 bytes *must*
153 requirements and avoid any allocation of 64K objects, at the expense of
157 progress reports. After compression, total_in holds the total size of
203 /* Possible values of the data_type field (though see inflate()) */
215 ZEXTERN const char * ZEXPORT zlibVersion OF((void));
223 ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
245 ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
252 The detailed semantics are as follows. deflate performs one or both of the
258 processing will resume at this point for the next call of deflate().
266 Before the call of deflate(), the application should ensure that at least
267 one of the actions is possible, by providing more input and/or consuming
271 (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
293 with the same value of the flush parameter and more output space (updated
295 avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
312 deflate() sets strm->adler to the adler32 checksum of all input read
331 ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
346 ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
353 accordingly; otherwise the allocation will be deferred to the first call of
365 implementation of inflateInit() does not process any header information --
370 ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
377 The detailed semantics are as follows. inflate performs one or both of the
383 will resume at this point for the next call of inflate().
390 Before the call of inflate(), the application should ensure that at least
391 one of the actions is possible, by providing more input and/or consuming
395 call of inflate(). If inflate returns Z_OK and with zero avail_out, it
399 The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
406 the end of that block, or when it runs out of data.
410 number of unused bits in the last byte taken from strm->next_in, plus 64
412 plus 128 if inflate() returned immediately after decoding an end-of-block
413 code or decoding the complete header up to just before the first byte of the
414 deflate stream. The end-of-block will not be indicated until all of the
416 number of unused bits may in general be greater than seven, except when
417 bit 7 of data_type is set, in which case the number of unused bits will be
422 (a single call of inflate), the parameter flush should be set to
425 uncompressed data. (The size of the uncompressed data may have been saved
427 be inflateEnd to deallocate the decompression state. The use of Z_FINISH
433 first call. So the only effect of the flush parameter in this implementation
434 is on the return value of inflate(), as noted below, or when it returns early
438 below), inflate sets strm->adler to the adler32 checksum of the dictionary
440 strm->adler to the adler32 checksum of all output produced so far (that is,
442 below. At the end of the stream, inflate() checks that its computed adler32
450 inflateBack() and perform their own processing of the gzip header and
454 or more output produced), Z_STREAM_END if the end of the compressed data has
465 of the data is desired.
469 ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
487 ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
494 This is another version of deflateInit with more compression options. The
499 this version of the library.
501 The windowBits parameter is the base two logarithm of the window size
502 (the size of the history buffer). It should be in the range 8..15 for this
503 version of the library. Larger values of this parameter result in better
504 compression at the expense of memory usage. The default value is 15 if
513 compressed data instead of a zlib wrapper. The gzip header will have no
516 gzip stream is being written, strm->adler is a crc32 instead of an adler32.
522 usage as a function of windowBits and memLevel.
528 encoding). Filtered data consists mostly of small values with a somewhat
530 compress them better. The effect of Z_FILTERED is to force more Huffman
534 parameter only affects the compression ratio but not the correctness of the
536 use of dynamic Huffman codes, allowing for a simpler decoder for special
545 ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
552 call of deflate. The compressor and decompressor must use exactly the same
555 The dictionary should consist of strings (byte sequences) that are likely
557 used strings preferably put towards the end of the dictionary. Using a
562 Depending on the size of the compression data structures selected by
563 deflateInit or deflateInit2, a part of the dictionary may in effect be
566 put at the end of the dictionary, not at the front. In addition, the
567 current implementation of deflate will use at most the window size minus
568 262 bytes of the provided dictionary.
570 Upon return of this function, strm->adler is set to the adler32 value
571 of the dictionary; the decompressor may later use this value to determine
573 applies to the whole dictionary even if only a subset of the dictionary is
584 ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
587 Sets the destination stream as a complete copy of the source stream.
590 tried, for example when there are several ways of pre-processing the input
594 can consume lots of memory.
602 ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
613 ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
618 interpretation of level and strategy is as in deflateInit2. This can be
619 used to switch between compression and straight copy of the input data, or
620 to switch to a different kind of input data requiring a different
623 take effect only at the next call of deflate().
625 Before the call of deflateParams, the stream state must be set as for
626 a call of deflate(), since the currently available input may have to
634 ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
644 specific input data. Read the deflate.c source code for the meaning of the
651 ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
655 deflation of sourceLen bytes. It must be called after deflateInit() or
661 ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
670 less than or equal to 16, and that many of the least significant bits of
677 ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
682 after deflateInit2() or deflateReset() and before the first call of
689 the current versions of the command-line version of gzip (up through version
702 ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
705 This is another version of inflateInit with an extra parameter. The
709 The windowBits parameter is the base two logarithm of the maximum window
710 size (the size of the history buffer). It should be in the range 8..15 for
711 this version of the library. The default value is 15 if inflateInit is used
716 Z_DATA_ERROR instead of trying to allocate a larger window.
721 looking for any check values for comparison at the end of the stream. This
728 above on the use in deflateInit2() applies to the magnitude of windowBits.
734 a crc32 instead of an adler32.
744 implementation of inflateInit2() does not process any header information --
748 ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
753 sequence. This function must be called immediately after a call of inflate,
755 can be determined from the adler32 value returned by that call of inflate.
758 immediately after inflateInit2() or inflateReset() and before any call of
766 perform any decompression: this will be done by subsequent calls of
770 ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
773 description of deflate with Z_FULL_FLUSH) can be found, or until all
779 case, the application may save the current current value of total_in which
782 until success or end of the input data.
785 ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
788 Sets the destination stream as a complete copy of the source stream.
801 ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
811 ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
817 middle of a byte. The provided bits will be used before any bytes are used
820 inflateReset(). bits must be less than or equal to 16, and that many of the
821 least significant bits of value will be inserted in the input.
827 ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
832 inflateInit2() or inflateReset(), and before the first call of inflate().
843 contains the maximum number of bytes to write to extra. Once done is true,
850 any of extra, name, or comment are not Z_NULL and the respective field is
852 absence. This allows the use of deflateSetHeader() with the returned
868 ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
875 logarithm of the window size, in the range 8..15. window is a caller
876 supplied buffer of that size. Except for special applications where it is
881 See inflateBack() for the usage of these routines.
883 inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
885 be allocated, or Z_VERSION_ERROR if the version of the library does not
886 match the version of the header file.
889 typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
890 typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
892 ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
914 normal behavior of inflate(), which expects either a zlib or gzip header and
919 routines until it reads a complete deflate stream and writes out all of the
923 number of bytes of provided input, and a pointer to that input in buf. If
929 are permitted to change the contents of the window provided to
932 amount of input may be provided by in().
942 The in_desc and out_desc parameters of inflateBack() is passed as the
943 first parameter of in() and out() respectively when they are called. These
949 return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
952 nature of
953 initialized. In the case of Z_BUF_ERROR, an input or output error can be
961 ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
969 ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
973 1.0: size of uInt
974 3.2: size of uLong
975 5.4: size of voidpf (pointer)
976 7.6: size of z_off_t
1014 The following utility functions are implemented on top of the
1017 standard memory allocation functions). The source code of these
1021 ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
1025 the byte length of the source buffer. Upon entry, destLen is the total
1026 size of the destination buffer, which must be at least the value returned
1027 by compressBound(sourceLen). Upon exit, destLen is the actual size of the
1036 ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
1042 length of the source buffer. Upon entry, destLen is the total size of the
1044 compressBound(sourceLen). Upon exit, destLen is the actual size of the
1052 ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
1059 ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
1063 the byte length of the source buffer. Upon entry, destLen is the total
1064 size of the destination buffer, which must be large enough to hold the
1065 entire uncompressed data. (The size of the uncompressed data must have
1067 by some mechanism outside the scope of this compression library.)
1068 Upon exit, destLen is the actual size of the compressed buffer.
1081 ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
1087 as in "wb1R". (See the description of deflateInit2 for more information
1098 ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
1104 The next call of gzclose on the returned gzFile will also close the
1111 ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
1114 of deflateInit2 for the meaning of these parameters.
1119 ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
1121 Reads the given number of uncompressed bytes from the compressed file.
1123 of bytes into the buffer.
1124 gzread returns the number of uncompressed bytes actually read (0 for
1125 end of file, -1 for error). */
1127 ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
1130 Writes the given number of uncompressed bytes into the compressed file.
1131 gzwrite returns the number of uncompressed bytes actually written
1132 (0 in case of error).
1135 ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
1138 control of the format string, as in fprintf. gzprintf returns the number of
1139 uncompressed bytes actually written (0 in case of error). The number of
1148 ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
1152 gzputs returns the number of characters written, or -1 in case of error.
1155 ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
1158 a newline character is read and transferred to buf, or an end-of-file
1161 gzgets returns buf, or Z_NULL in case of error.
1164 ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
1167 gzputc returns the value that was written, or -1 in case of error.
1170 ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
1173 or -1 in case of end of file or error.
1176 ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
1179 Only one character of push-back is allowed. gzungetc() returns the
1186 ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
1197 ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
1201 given compressed file. The offset represents a number of bytes in the
1206 supported; gzseek then compresses a sequence of zeroes up to the new
1210 the beginning of the uncompressed stream, or -1 in case of error, in
1215 ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
1223 ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
1226 given compressed file. This position represents a number of bytes in the
1232 ZEXTERN int ZEXPORT gzeof OF((gzFile file));
1238 ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
1244 ZEXTERN int ZEXPORT gzclose OF((gzFile file));
1252 ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
1264 ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
1266 Clears the error and end-of-file flags for file. This is analogous to the
1279 ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
1296 ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
1299 Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
1301 each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
1305 ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
1322 ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
1324 Combine two CRC-32 check values into one. For two sequences of bytes,
1327 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
1335 * and the compiler's view of z_stream:
1337 ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
1339 ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
1341 ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
1345 ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
1347 ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
1365 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
1366 ZEXTERN off64_t ZEXPORT gzseek64 OF((gzFile, off64_t, int));
1367 ZEXTERN off64_t ZEXPORT gztell64 OF((gzFile));
1368 ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, off64_t));
1369 ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, off64_t));
1379 ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
1380 ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
1381 ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
1382 ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
1383 ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
1390 ZEXTERN const char * ZEXPORT zError OF((int));
1391 ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
1392 ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
1393 ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));