Skip to content
REFERENCE / ZLIB × LEAN

API contracts

The complete public-interface index

95 default-build entries, plus Windows gzopen_w. Every entry retains its signature, domain, preconditions, results, memory effects, and error paths. The documented contract and the Lean goal may differ in scope; each is shown as it is.

adler3232-bit checksumUpdate an Adler-32 checksum using a 32-bit byte count.Checksumsadler32_combineChecksum or length-rejection valueCompute the Adler-32 of A followed by B without reading either sequence.Checksumsadler32_combine64Checksum or length-rejection valueCompute the Adler-32 of A followed by B with an explicit 64-bit length.Checksumsadler32_z32-bit checksumUpdate an Adler-32 checksum with a byte range, or obtain its initial value.Checksumscompresszlib status code; output length is written separatelyThe uLong compressor at the default level.Buffers and library informationcompress2zlib status code; output length is written separatelyThe uLong form of compress2_z.Buffers and library informationcompress2_zzlib status code; output length is written separatelyCompresses the input into one complete zlib stream at the requested level.Buffers and library informationcompressBoundSaturated compression-capacity valueThe uLong form of the numeric bound.Buffers and library informationcompressBound_zSaturated compression-capacity valueCalculates the numeric bound used to size a default zlib compression buffer.Buffers and library informationcompress_zzlib status code; output length is written separatelyCompresses at the default level (-1, selecting level 6).Buffers and library informationcrc3232-bit checksumUpdate a CRC-32 checksum using a 32-bit byte count.Checksumscrc32_combineChecksum or length-rejection valueCompute the CRC-32 of A followed by B using the ordinary offset type.Checksumscrc32_combine64Checksum or length-rejection valueCompute the CRC-32 of A followed by B without reading either sequence.Checksumscrc32_combine_genCRC combination operatorGenerate a CRC combination operator using the ordinary offset type.Checksumscrc32_combine_gen64CRC combination operatorGenerate an operator for repeated CRC combinations with the same B length.Checksumscrc32_combine_opCRC-32 checksum or operator-rejection valueCompute the CRC-32 of A followed by B using a previously generated operator.Checksumscrc32_z32-bit checksumUpdate a CRC-32 checksum with a byte range, or obtain its initial value.Checksumsdeflatezlib status codeAccept input and deliver part or all of a valid compressed stream.Compression streamsdeflateBoundOutput-capacity bound (bytes)Return the uLong form of the compression bound.Compression streamsdeflateBound_zOutput-capacity bound (bytes)Compute a size bound using the stream's current configuration and wrapper.Compression streamsdeflateCopyzlib status codeCreate an independent compressor with the same compression progress.Compression streamsdeflateEndzlib status codeRelease the compressor, discarding any unfinished work.Compression streamsdeflateGetDictionaryzlib status codeRead the current compression history, including accepted lookahead.Compression streamsdeflateInit2_zlib status codeStart a compressor with a chosen wrapper and compression settings.Compression streamsdeflateInit_zlib status codeStart a compressor with the default zlib wrapper and compression settings.Compression streamsdeflateParamszlib status codeChange level and strategy, finishing the old block when needed.Compression streamsdeflatePendingzlib status codeReport output waiting inside the compressor.Compression streamsdeflatePrimezlib status codePrefix raw compression output with a caller-supplied bit fragment.Compression streamsdeflateResetzlib status codeReuse a stream for new compression with empty history.Compression streamsdeflateResetKeepzlib status codeRestart output and progress counters while retaining compression history.Compression streamsdeflateSetDictionaryzlib status codeLoad preset bytes as compression history without emitting them as input data.Compression streamsdeflateSetHeaderzlib status codeSelect the header for the next gzip stream.Compression streamsdeflateTunezlib status codeSet the four expert match-search tuning values.Compression streamsdeflateUsedzlib status codeReport the last byte's bit use at the most recent byte-boundary flush.Compression streamsget_crc_tableBorrowed read-only table pointerReturn the library's byte-at-a-time CRC table.ChecksumsgzbufferZero / minus-one control resultChoose the requested buffer size before buffers exist.Gzip filesgzclearerrState reset with no return valueClear recorded error information and rearm reader EOF detection.Gzip filesgzclosezlib close status codeClose a reader or finish and close a writer.Gzip filesgzclose_rzlib close status codeRelease a reader and close its descriptor without further decompression.Gzip filesgzclose_wzlib close status codeFinish buffered output, release a writer and close its descriptor.Gzip filesgzdirectTransparent-mode flag, not error statusReport whether the handle is using transparent data.Gzip filesgzdopenOwned handle or failure sentinelWrap an existing descriptor without opening or duplicating it.Gzip filesgzeofPast-EOF flagQuery whether a reader has tried to read beyond available data.Gzip filesgzerrorBorrowed message pointer; optional error-code outputRead the handle's current error code and message.Gzip filesgzflushzlib status codeProcess buffered output using the requested flush mode.Gzip filesgzfreadComplete items readRead up to nitems items of size uncompressed bytes.Gzip filesgzfwriteComplete accepted item countAccept up to nitems items of size uncompressed bytes.Gzip filesgzgetcUnsigned byte value, or failure/EOF sentinelRead one uncompressed byte as an unsigned value.Gzip filesgzgetc_Unsigned byte value, or failure/EOF sentinelProvide the exported wrapper for single-byte reading.Gzip filesgzgetsCaller buffer pointer, or NULLRead a line fragment and terminate it with NUL.Gzip filesgzoffsetPhysical file offset, or failure sentinelQuery physical file offset using z_off_t.Gzip filesgzoffset64Physical file offset, or failure sentinelQuery the underlying physical file offset.Gzip filesgzopenOwned handle or failure sentinelOpen a path for reading, writing or appending.Gzip filesgzopen64Owned handle or failure sentinelOpen using the large-file entry point.Gzip filesgzopen_wOwned handle or failure sentinelOpen a Windows wide-character path.Gzip files · WindowsgzprintfFormatted byte count, zero, or zlib error codeFormat arguments and accept the resulting bytes for output.Gzip filesgzputcAccepted byte value or failure sentinelAccept the low eight bits of c for output.Gzip filesgzputsAccepted string byte count or failure sentinelAccept a NUL-terminated string, excluding its terminator.Gzip filesgzreadUncompressed byte count, or failure sentinelRead up to len uncompressed bytes.Gzip filesgzrewindRewind success/failure sentinelReset a reader to its saved descriptor start.Gzip filesgzseekRequested uncompressed position, or failure sentinelRequest an uncompressed position through the ordinary offset type.Gzip filesgzseek64Requested uncompressed position, or failure sentinelRequest an uncompressed position relative to start or current position.Gzip filesgzsetparamszlib status codeRequest a new compression level and strategy for subsequent input.Gzip filesgztellLogical uncompressed position; -1 can also signal failureQuery logical uncompressed position using z_off_t.Gzip filesgztell64Logical uncompressed position; -1 can also signal failureQuery the current logical uncompressed position.Gzip filesgzungetcOriginal nonnegative argument, or failure sentinelPush one byte onto a reader's uncompressed input.Gzip filesgzvprintfFormatted byte count, zero, or zlib error codeFormat a va_list and accept the result for output.Gzip filesgzwriteAccepted uncompressed byte countAccept len uncompressed bytes for output.Gzip filesinflatezlib status codeConsume compressed bytes and write decoded bytes, preserving state across calls.Decompression streamsinflateBackzlib status codePurpose. Decode one complete raw stream through the input and output callbacks.Callback decodinginflateBackEndzlib status codePurpose. Release the state allocated by callback init.Callback decodinginflateBackInit_zlib status codePurpose. Allocate decoder state and attach the caller's window. The inflateBackInit macro supplies version and stream_size.Callback decodinginflateCodesUsedDecoding-table entry count or error sentinelReport the decoding-table entries used so far. This is an undocumented entry point. The unit is a table entry, not a bit or a byte: one entry records the symbol or the next operation that one table lookup yields.Decompression streamsinflateCopyzlib status codeCreate a decoder that can resume from the source position.Decompression streamsinflateEndzlib status codeRelease decoder storage, including when decoding was abandoned or failed.Decompression streamsinflateGetDictionaryzlib status codeRead the retained sliding history, oldest byte first.Decompression streamsinflateGetHeaderzlib status codeRegister caller storage for the next gzip header.Decompression streamsinflateInit2_zlib status codeCreate a decoder with a selected wrapper and window.Decompression streamsinflateInit_zlib status codeCreate a zlib decoder with a 32 KiB maximum window.Decompression streamsinflateMarkPacked position and progress, or an overlapping error sentinelReport the current code position for indexing.Decompression streamsinflatePrimezlib status codeSupply bits before the next input byte, or clear buffered bits.Decompression streamsinflateResetzlib status codeStart a new independent compressed stream using the existing configuration.Decompression streamsinflateReset2zlib status codeReset and select a new wrapper and maximum window size.Decompression streamsinflateResetKeepzlib status codeRestart decoding while retaining history. This is an undocumented entry point.Decompression streamsinflateSetDictionaryzlib status codeInstall or amend the bytes available for backward matches.Decompression streamsinflateSynczlib status codeSearch for a possible full-flush boundary after damaged input.Decompression streamsinflateSyncPointState query value or error codeTest whether stored-block length bytes are the next thing expected.Decompression streamsinflateUnderminezlib status codeRequest the optional permissive-distance mode. This is an undocumented entry point.Decompression streamsinflateValidatezlib status codeEnable or disable wrapper checksum and gzip length validation.Decompression streamsuncompresszlib status code; counts are reported through length parametersThe uLong decoder without a consumed-input count.Buffers and library informationuncompress2zlib status code; counts are reported through length parametersThe uLong decoder with an input-consumption count.Buffers and library informationuncompress2_zzlib status code; counts are reported through length parametersDecodes the first zlib stream and reports both output size and input consumption.Buffers and library informationuncompress_zzlib status code; counts are reported through length parametersDecodes without exposing the consumed-input count.Buffers and library informationzErrorBorrowed immutable error-text pointerReturns the text associated with a zlib result code.Buffers and library informationzlibCompileFlagsBuild-information bit fieldsReports the build's type sizes and compile-time options.Buffers and library informationzlibVersionBorrowed immutable version-string pointerReturns the linked library's release string.Buffers and library information
ZLIB × LEAN

Contents

READING NOWAPI contracts