The IBM-provided zlib compatible
C library provides the following query functions in addition to the
standard zlib functions:
- deflateHwAvail(buflen)
- Determines if the compression accelerator is available for a deflate
operation. The input parameter buflen is an integer
that represents the input buffer size of the first deflate request.
The function returns an integer with a value of 1 if the compression
accelerator will be used for the deflate operation or a value of 0
if software will be used instead.
- inflateHwAvail(buflen)
- Determines if the compression accelerator is available for an
inflate operation. The input parameter buflen is
an integer that represents the input buffer size of the first inflate
request. The function returns an integer with a value of 1 if the
compression accelerator will be used for this inflate operation or
a value of 0 if software will be used instead.
- hwCheck(strm)
- Determines if a zlib stream is using the compression accelerator
or software compression. The input parameter strm is
a pointer to a zlib z_stream structure to check. The function returns
an integer with a value of 0 if the stream has gone to the compression
accelerator, a value of 1 if the stream is pending to go to the compression
accelerator, but still could fall back to software compression, a
value of 2 if the stream has gone to software compression, or Z_STREAM_ERROR
if the stream has not been initialized correctly.