The value of the last error code, negative integer\&. All other error code values are in the range from \fBBROTLI_LAST_ERROR_CODE\fP to \fC-1\fP\&. There are also 4 other possible non-error codes \fC0\fP\&.\&. \fC3\fP in \fBBrotliDecoderErrorCode\fP enumeration\&.
Opaque structure that holds decoder state\&. Allocated and initialized with \fBBrotliDecoderCreateInstance\fP\&. Cleaned up and deallocated with \fBBrotliDecoderDestroyInstance\fP\&.
.SH"Enumeration Type Documentation"
.PP
.SS"enum \fBBrotliDecoderErrorCode\fP"
.PP
Error code for detailed logging / production debugging\&. See \fBBrotliDecoderGetErrorCode\fP and \fBBROTLI_LAST_ERROR_CODE\fP\&.
.SS"enum \fBBrotliDecoderResult\fP"
.PP
Result type for \fBBrotliDecoderDecompress\fP and \fBBrotliDecoderDecompressStream\fP functions\&.
.PP
\fBEnumerator\fP
.in+1c
.TP
\fB\fIBROTLI_DECODER_RESULT_ERROR \fP\fP
Decoding error, e\&.g\&. corrupted input or memory allocation problem\&.
Creates an instance of \fBBrotliDecoderState\fP and initializes it\&. The instance can be used once for decoding and should then be destroyed with \fBBrotliDecoderDestroyInstance\fP, it cannot be reused for a new decoding session\&.
.PP
\fCalloc_func\fP and \fCfree_func\fP\fBMUST\fP be both zero or both non-zero\&. In the case they are both zero, default memory allocators are used\&. \fCopaque\fP is passed to \fCalloc_func\fP and \fCfree_func\fP when they are called\&.
.PP
\fBParameters:\fP
.RS4
\fIalloc_func\fP custom memory allocation function
.br
\fIfree_func\fP custom memory fee function
.br
\fIopaque\fP custom memory manager handle
.RE
.PP
\fBReturns:\fP
.RS4
\fC0\fP if instance can not be allocated or initialized
.PP
pointer to initialized \fBBrotliDecoderState\fP otherwise
Performs one-shot memory-to-memory decompression\&. Decompresses the data in \fCencoded_buffer\fP into \fCdecoded_buffer\fP, and sets \fC*decoded_size\fP to the decompressed length\&.
.PP
\fBParameters:\fP
.RS4
\fIencoded_size\fP size of \fCencoded_buffer\fP
.br
\fIencoded_buffer\fP compressed data buffer with at least \fCencoded_size\fP addressable bytes
.br
\fIdecoded_size\fP\fBin:\fP size of \fCdecoded_buffer\fP;
.br
\fBout:\fP length of decompressed data written to \fCdecoded_buffer\fP
.br
\fIdecoded_buffer\fP decompressed data destination buffer
.RE
.PP
\fBReturns:\fP
.RS4
\fBBROTLI_DECODER_RESULT_ERROR\fP if input is corrupted, memory allocation failed, or \fCdecoded_buffer\fP is not large enough;
Decompresses the input stream to the output stream\&. The values \fC*available_in\fP and \fC*available_out\fP must specify the number of bytes addressable at \fC*next_in\fP and \fC*next_out\fP respectively\&. When \fC*available_out\fP is \fC0\fP, \fCnext_out\fP is allowed to be \fCNULL\fP\&.
.PP
After each call, \fC*available_in\fP will be decremented by the amount of input bytes consumed, and the \fC*next_in\fP pointer will be incremented by that amount\&. Similarly, \fC*available_out\fP will be decremented by the amount of output bytes written, and the \fC*next_out\fP pointer will be incremented by that amount\&.
.PP
\fCtotal_out\fP, if it is not a null-pointer, will be set to the number of bytes decompressed since the last \fCstate\fP initialization\&.
.PP
\fBNote:\fP
.RS4
Input is never overconsumed, so \fCnext_in\fP and \fCavailable_in\fP could be passed to the next consumer after decoding is complete\&.
.RE
.PP
\fBParameters:\fP
.RS4
\fIstate\fP decoder instance
.br
\fIavailable_in\fP\fBin:\fP amount of available input;
.br
\fBout:\fP amount of unused input
.br
\fInext_in\fP pointer to the next compressed byte
.br
\fIavailable_out\fP\fBin:\fP length of output buffer;
.br
\fBout:\fP remaining size of output buffer
.br
\fInext_out\fP output buffer cursor; can be \fCNULL\fP if \fCavailable_out\fP is \fC0\fP
.br
\fItotal_out\fP number of bytes decompressed so far; can be \fCNULL\fP
.RE
.PP
\fBReturns:\fP
.RS4
\fBBROTLI_DECODER_RESULT_ERROR\fP if input is corrupted, memory allocation failed, arguments were invalid, etc\&.; use \fBBrotliDecoderGetErrorCode\fP to get detailed error code
Acquires pointer to internal output buffer\&. This method is used to make language bindings easier and more efficient:
.IP"1."4
push data to \fBBrotliDecoderDecompressStream\fP, until \fBBROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT\fP is reported
.IP"2."4
use \fBBrotliDecoderTakeOutput\fP to peek bytes and copy to language-specific entity
.PP
.PP
Also this could be useful if there is an output stream that is able to consume all the provided data (e\&.g\&. when data is saved to file system)\&.
.PP
\fBAttention:\fP
.RS4
After every call to \fBBrotliDecoderTakeOutput\fP\fC*size\fP bytes of output are considered consumed for all consecutive calls to the instance methods; returned pointer becomes invalidated as well\&.
.RE
.PP
\fBNote:\fP
.RS4
Decoder output is not guaranteed to be contiguous\&. This means that after the size-unrestricted call to \fBBrotliDecoderTakeOutput\fP, immediate next call to \fBBrotliDecoderTakeOutput\fP may return more data\&.
.RE
.PP
\fBParameters:\fP
.RS4
\fIstate\fP decoder instance
.br
\fIsize\fP\fBin:\fP number of bytes caller is ready to take, \fC0\fP if any amount could be handled;
.br
\fBout:\fP amount of data pointed by returned pointer and considered consumed;
.br
out value is never greater than in value, unless it is \fC0\fP
.RE
.PP
\fBReturns:\fP
.RS4
pointer to output data
.RE
.PP
.SS"uint32_t BrotliDecoderVersion (void)"
.PP
Gets a decoder library version\&. Look at BROTLI_VERSION for more information\&.
.SH"Author"
.PP
Generated automatically by Doxygen for Brotli from the source code\&.