|
ZLIB
|
Inflate using a call-back interface. More...
#include "zutil.h"#include "inftrees.h"#include "inflate.h"#include "inffast.h"#include "inffixed.h"Macros | |
| #define | LOAD() |
| Load returned state from inflate_fast() | |
| #define | RESTORE() |
| Set state from registers for inflate_fast() | |
| #define | INITBITS() |
| Clear the input bit accumulator. | |
| #define | PULL() |
| Assure that some input is available. | |
| #define | PULLBYTE() |
| Get a byte of input into the bit accumulator, or return from inflateBack() with an error if there is no input available. | |
| #define | NEEDBITS(n) |
| Assure that there are at least n bits in the bit accumulator. | |
| #define | BITS(n) ((unsigned)hold & ((1U << (n)) - 1)) |
| Return the low n bits of the bit accumulator (n < 16) | |
| #define | DROPBITS(n) |
| Remove n bits from the bit accumulator. | |
| #define | BYTEBITS() |
| Remove zero to seven bits as needed to go to a byte boundary. | |
| #define | ROOM() |
| Assure that some output space is available, by writing out the window if it's full. | |
Functions | |
| int ZEXPORT | inflateBackInit_ (z_streamp strm, int windowBits, unsigned char *window, const char *version, int stream_size) |
| Initialize the internal stream state for decompression using inflateBack() calls. | |
| int ZEXPORT | inflateBack (z_streamp strm, in_func in, void *in_desc, out_func out, void *out_desc) |
| Does a raw inflate with a single call using a call-back interface for input and output. | |
| int ZEXPORT | inflateBackEnd (z_streamp strm) |
| All memory allocated by inflateBackInit() is freed. | |
Inflate using a call-back interface.
Copyright (C) 1995-2022 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h
This code is largely copied from inflate.c. Normally either infback.o or inflate.o would be linked into an application–not both. The interface with inffast.c is retained so that optimized assembler-coded versions of inflate_fast() can be used with either inflate.c or infback.c.
| #define BYTEBITS | ( | ) |
Remove zero to seven bits as needed to go to a byte boundary.
| #define DROPBITS | ( | n | ) |
Remove n bits from the bit accumulator.
| #define INITBITS | ( | ) |
Clear the input bit accumulator.
| #define LOAD | ( | ) |
Load returned state from inflate_fast()
| #define NEEDBITS | ( | n | ) |
Assure that there are at least n bits in the bit accumulator.
If there is not enough available input to do that, then return from inflateBack() with an error.
| #define PULL | ( | ) |
Assure that some input is available.
If input is requested, but denied, then return a Z_BUF_ERROR from inflateBack().
| #define PULLBYTE | ( | ) |
Get a byte of input into the bit accumulator, or return from inflateBack() with an error if there is no input available.
| #define RESTORE | ( | ) |
Set state from registers for inflate_fast()
| #define ROOM | ( | ) |
Assure that some output space is available, by writing out the window if it's full.
If the write fails, return from inflateBack() with a Z_BUF_ERROR.
| int ZEXPORT inflateBackInit_ | ( | z_streamp | strm, |
| int | windowBits, | ||
| unsigned char * | window, | ||
| const char * | version, | ||
| int | stream_size | ||
| ) |
Initialize the internal stream state for decompression using inflateBack() calls.
The fields zalloc, zfree and opaque in strm must be initialized before the call. If zalloc and zfree are Z_NULL, then the default library- derived memory allocation routines are used. windowBits is the base two logarithm of the window size, in the range 8..15. window is a caller supplied buffer of that size. Except for special applications where it is assured that deflate was used with small window sizes, windowBits must be 15 and a 32K byte window must be supplied to be able to decompress general deflate streams.
See inflateBack() for the usage of these routines.