Home | History | Annotate | Download | only in zlib-1.2.3

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
45 decompression functions, including integrity checks of the uncompressed
46 data. This version of the library supports only one compression method
52 repeated calls of the compression function. In the latter case, the
61 with an interface similar to that of stdio using the functions that start
73 the consistency of the compressed data, so the library should never
74 crash even in case of corrupted input.
77 typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
78 typedef void (*free_func) OF((voidpf opaque, voidpf address));
84 uInt avail_in; /* number of bytes available at next_in */
85 uLong total_in; /* total nb of input bytes read so far */
89 uLong total_out; /* total nb of bytes output so far */
99 uLong adler; /* adler32 value of the uncompressed data */
107 for more details on the meanings of these fields.
136 parameter for calls of zalloc and zfree. This can be useful for custom
147 pointers returned by zalloc for objects of exactly 65536 bytes *must*
150 requirements and avoid any allocation of 64K objects, at the expense of
154 progress reports. After compression, total_in holds the total size of
200 /* Possible values of the data_type field (though see inflate()) */
212 ZEXTERN const char * ZEXPORT zlibVersion OF((void));
220 ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
242 ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
249 The detailed semantics are as follows. deflate performs one or both of the
255 processing will resume at this point for the next call of deflate().
263 Before the call of deflate(), the application should ensure that at least
264 one of the actions is possible, by providing more input and/or consuming
268 (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
290 with the same value of the flush parameter and more output space (updated
292 avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
309 deflate() sets strm->adler to the adler32 checksum of all input read
328 ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
343 ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
350 accordingly; otherwise the allocation will be deferred to the first call of
363 ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
370 The detailed semantics are as follows. inflate performs one or both of the
376 will resume at this point for the next call of inflate().
383 Before the call of inflate(), the application should ensure that at least
384 one of the actions is possible, by providing more input and/or consuming
388 call of inflate(). If inflate returns Z_OK and with zero avail_out, it
392 The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
399 the end of that block, or when it runs out of data.
403 number of unused bits in the last byte taken from strm->next_in, plus 64
405 plus 128 if inflate() returned immediately after decoding an end-of-block
406 code or decoding the complete header up to just before the first byte of the
407 deflate stream. The end-of-block will not be indicated until all of the
409 number of unused bits may in general be greater than seven, except when
410 bit 7 of data_type is set, in which case the number of unused bits will be
415 (a single call of inflate), the parameter flush should be set to
418 uncompressed data. (The size of the uncompressed data may have been saved
420 be inflateEnd to deallocate the decompression state. The use of Z_FINISH
426 first call. So the only effect of the flush parameter in this implementation
427 is on the return value of inflate(), as noted below, or when it returns early
431 below), inflate sets strm->adler to the adler32 checksum of the dictionary
433 strm->adler to the adler32 checksum of all output produced so far (that is,
435 below. At the end of the stream, inflate() checks that its computed adler32
443 inflateBack() and perform their own processing of the gzip header and
447 or more output produced), Z_STREAM_END if the end of the compressed data has
458 of the data is desired.
462 ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
480 ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
487 This is another version of deflateInit with more compression options. The
492 this version of the library.
494 The windowBits parameter is the base two logarithm of the window size
495 (the size of the history buffer). It should be in the range 8..15 for this
496 version of the library. Larger values of this parameter result in better
497 compression at the expense of memory usage. The default value is 15 if
506 compressed data instead of a zlib wrapper. The gzip header will have no
509 gzip stream is being written, strm->adler is a crc32 instead of an adler32.
515 usage as a function of windowBits and memLevel.
521 encoding). Filtered data consists mostly of small values with a somewhat
523 compress them better. The effect of Z_FILTERED is to force more Huffman
527 parameter only affects the compression ratio but not the correctness of the
529 use of dynamic Huffman codes, allowing for a simpler decoder for special
538 ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
545 call of deflate. The compressor and decompressor must use exactly the same
548 The dictionary should consist of strings (byte sequences) that are likely
550 used strings preferably put towards the end of the dictionary. Using a
555 Depending on the size of the compression data structures selected by
556 deflateInit or deflateInit2, a part of the dictionary may in effect be
559 put at the end of the dictionary, not at the front. In addition, the
560 current implementation of deflate will use at most the window size minus
561 262 bytes of the provided dictionary.
563 Upon return of this function, strm->adler is set to the adler32 value
564 of the dictionary; the decompressor may later use this value to determine
566 applies to the whole dictionary even if only a subset of the dictionary is
577 ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
580 Sets the destination stream as a complete copy of the source stream.
583 tried, for example when there are several ways of pre-processing the input
587 can consume lots of memory.
595 ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
606 ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
611 interpretation of level and strategy is as in deflateInit2. This can be
612 used to switch between compression and straight copy of the input data, or
613 to switch to a different kind of input data requiring a different
616 take effect only at the next call of deflate().
618 Before the call of deflateParams, the stream state must be set as for
619 a call of deflate(), since the currently available input may have to
627 ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
637 specific input data. Read the deflate.c source code for the meaning of the
644 ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
648 deflation of sourceLen bytes. It must be called after deflateInit()
653 ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
662 less than or equal to 16, and that many of the least significant bits of
669 ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
674 after deflateInit2() or deflateReset() and before the first call of
681 the current versions of the command-line version of gzip (up through version
694 ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
697 This is another version of inflateInit with an extra parameter. The
701 The windowBits parameter is the base two logarithm of the maximum window
702 size (the size of the history buffer). It should be in the range 8..15 for
703 this version of the library. The default value is 15 if inflateInit is used
708 Z_DATA_ERROR instead of trying to allocate a larger window.
713 looking for any check values for comparison at the end of the stream. This
720 above on the use in deflateInit2() applies to the magnitude of windowBits.
726 a crc32 instead of an adler32.
736 ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
741 sequence. This function must be called immediately after a call of inflate,
743 can be determined from the adler32 value returned by that call of inflate.
746 immediately after inflateInit2() or inflateReset() and before any call of
754 perform any decompression: this will be done by subsequent calls of
758 ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
761 description of deflate with Z_FULL_FLUSH) can be found, or until all
767 case, the application may save the current current value of total_in which
770 until success or end of the input data.
773 ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
776 Sets the destination stream as a complete copy of the source stream.
789 ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
799 ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
805 middle of a byte. The provided bits will be used before any bytes are used
808 inflateReset(). bits must be less than or equal to 16, and that many of the
809 least significant bits of value will be inserted in the input.
815 ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
820 inflateInit2() or inflateReset(), and before the first call of inflate().
831 contains the maximum number of bytes to write to extra. Once done is true,
838 any of extra, name, or comment are not Z_NULL and the respective field is
840 absence. This allows the use of deflateSetHeader() with the returned
856 ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
863 logarithm of the window size, in the range 8..15. window is a caller
864 supplied buffer of that size. Except for special applications where it is
869 See inflateBack() for the usage of these routines.
871 inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
873 be allocated, or Z_VERSION_ERROR if the version of the library does not
874 match the version of the header file.
877 typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
878 typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
880 ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
902 normal behavior of inflate(), which expects either a zlib or gzip header and
907 routines until it reads a complete deflate stream and writes out all of the
911 number of bytes of provided input, and a pointer to that input in buf. If
917 are permitted to change the contents of the window provided to
920 amount of input may be provided by in().
930 The in_desc and out_desc parameters of inflateBack() is passed as the
931 first parameter of in() and out() respectively when they are called. These
937 return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
940 nature of the error), or Z_STREAM_ERROR if the stream was not properly
941 initialized. In the case of Z_BUF_ERROR, an input or output error can be
949 ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
957 ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
961 1.0: size of uInt
962 3.2: size of uLong
963 5.4: size of voidpf (pointer)
964 7.6: size of z_off_t
1002 The following utility functions are implemented on top of the
1005 standard memory allocation functions). The source code of these
1009 ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
1013 the byte length of the source buffer. Upon entry, destLen is the total
1014 size of the destination buffer, which must be at least the value returned
1015 by compressBound(sourceLen). Upon exit, destLen is the actual size of the
1024 ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
1030 length of the source buffer. Upon entry, destLen is the total size of the
1032 compressBound(sourceLen). Upon exit, destLen is the actual size of the
1040 ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
1047 ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
1051 the byte length of the source buffer. Upon entry, destLen is the total
1052 size of the destination buffer, which must be large enough to hold the
1053 entire uncompressed data. (The size of the uncompressed data must have
1055 by some mechanism outside the scope of this compression library.)
1056 Upon exit, destLen is the actual size of the compressed buffer.
1068 ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
1074 as in "wb1R". (See the description of deflateInit2 for more information
1085 ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
1091 The next call of gzclose on the returned gzFile will also close the
1098 ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
1101 of deflateInit2 for the meaning of these parameters.
1106 ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
1108 Reads the given number of uncompressed bytes from the compressed file.
1110 of bytes into the buffer.
1111 gzread returns the number of uncompressed bytes actually read (0 for
1112 end of file, -1 for error). */
1114 ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
1117 Writes the given number of uncompressed bytes into the compressed file.
1118 gzwrite returns the number of uncompressed bytes actually written
1119 (0 in case of error).
1122 ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
1125 control of the format string, as in fprintf. gzprintf returns the number of
1126 uncompressed bytes actually written (0 in case of error). The number of
1135 ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
1139 gzputs returns the number of characters written, or -1 in case of error.
1142 ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
1145 a newline character is read and transferred to buf, or an end-of-file
1148 gzgets returns buf, or Z_NULL in case of error.
1151 ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
1154 gzputc returns the value that was written, or -1 in case of error.
1157 ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
1160 or -1 in case of end of file or error.
1163 ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
1166 Only one character of push-back is allowed. gzungetc() returns the
1173 ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
1183 ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
1187 given compressed file. The offset represents a number of bytes in the
1192 supported; gzseek then compresses a sequence of zeroes up to the new
1196 the beginning of the uncompressed stream, or -1 in case of error, in
1201 ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
1208 ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
1211 given compressed file. This position represents a number of bytes in the
1217 ZEXTERN int ZEXPORT gzeof OF((gzFile file));
1223 ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
1229 ZEXTERN int ZEXPORT gzclose OF((gzFile file));
1236 ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
1245 ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
1247 Clears the error and end-of-file flags for file. This is analogous to the
1260 ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
1276 ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
1279 Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
1281 each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
1285 ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
1301 ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
1304 Combine two CRC-32 check values into one. For two sequences of bytes,
1307 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
1315 * and the compiler's view of z_stream:
1317 ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
1319 ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
1321 ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
1325 ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
1327 ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
1349 ZEXTERN const char * ZEXPORT zError OF((int));
1350 ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
1351 ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));