12#ifndef BROTLI_DEC_DECODE_H_
13#define BROTLI_DEC_DECODE_H_
15#include <brotli/port.h>
16#include <brotli/shared_dictionary.h>
17#include <brotli/types.h>
19#if defined(__cplusplus) || defined(c_plusplus)
64#define BROTLI_DECODER_ERROR_CODES_LIST(BROTLI_ERROR_CODE, SEPARATOR) \
65 BROTLI_ERROR_CODE(_, NO_ERROR, 0) SEPARATOR \
67 BROTLI_ERROR_CODE(_, SUCCESS, 1) SEPARATOR \
68 BROTLI_ERROR_CODE(_, NEEDS_MORE_INPUT, 2) SEPARATOR \
69 BROTLI_ERROR_CODE(_, NEEDS_MORE_OUTPUT, 3) SEPARATOR \
72 BROTLI_ERROR_CODE(_ERROR_FORMAT_, EXUBERANT_NIBBLE, -1) SEPARATOR \
73 BROTLI_ERROR_CODE(_ERROR_FORMAT_, RESERVED, -2) SEPARATOR \
74 BROTLI_ERROR_CODE(_ERROR_FORMAT_, EXUBERANT_META_NIBBLE, -3) SEPARATOR \
75 BROTLI_ERROR_CODE(_ERROR_FORMAT_, SIMPLE_HUFFMAN_ALPHABET, -4) SEPARATOR \
76 BROTLI_ERROR_CODE(_ERROR_FORMAT_, SIMPLE_HUFFMAN_SAME, -5) SEPARATOR \
77 BROTLI_ERROR_CODE(_ERROR_FORMAT_, CL_SPACE, -6) SEPARATOR \
78 BROTLI_ERROR_CODE(_ERROR_FORMAT_, HUFFMAN_SPACE, -7) SEPARATOR \
79 BROTLI_ERROR_CODE(_ERROR_FORMAT_, CONTEXT_MAP_REPEAT, -8) SEPARATOR \
80 BROTLI_ERROR_CODE(_ERROR_FORMAT_, BLOCK_LENGTH_1, -9) SEPARATOR \
81 BROTLI_ERROR_CODE(_ERROR_FORMAT_, BLOCK_LENGTH_2, -10) SEPARATOR \
82 BROTLI_ERROR_CODE(_ERROR_FORMAT_, TRANSFORM, -11) SEPARATOR \
83 BROTLI_ERROR_CODE(_ERROR_FORMAT_, DICTIONARY, -12) SEPARATOR \
84 BROTLI_ERROR_CODE(_ERROR_FORMAT_, WINDOW_BITS, -13) SEPARATOR \
85 BROTLI_ERROR_CODE(_ERROR_FORMAT_, PADDING_1, -14) SEPARATOR \
86 BROTLI_ERROR_CODE(_ERROR_FORMAT_, PADDING_2, -15) SEPARATOR \
87 BROTLI_ERROR_CODE(_ERROR_FORMAT_, DISTANCE, -16) SEPARATOR \
91 BROTLI_ERROR_CODE(_ERROR_, COMPOUND_DICTIONARY, -18) SEPARATOR \
92 BROTLI_ERROR_CODE(_ERROR_, DICTIONARY_NOT_SET, -19) SEPARATOR \
93 BROTLI_ERROR_CODE(_ERROR_, INVALID_ARGUMENTS, -20) SEPARATOR \
96 BROTLI_ERROR_CODE(_ERROR_ALLOC_, CONTEXT_MODES, -21) SEPARATOR \
98 BROTLI_ERROR_CODE(_ERROR_ALLOC_, TREE_GROUPS, -22) SEPARATOR \
100 BROTLI_ERROR_CODE(_ERROR_ALLOC_, CONTEXT_MAP, -25) SEPARATOR \
101 BROTLI_ERROR_CODE(_ERROR_ALLOC_, RING_BUFFER_1, -26) SEPARATOR \
102 BROTLI_ERROR_CODE(_ERROR_ALLOC_, RING_BUFFER_2, -27) SEPARATOR \
104 BROTLI_ERROR_CODE(_ERROR_ALLOC_, BLOCK_TYPE_TREES, -30) SEPARATOR \
107 BROTLI_ERROR_CODE(_ERROR_, UNREACHABLE, -31)
115#define BROTLI_COMMA_ ,
116#define BROTLI_ERROR_CODE_ENUM_ITEM_(PREFIX, NAME, CODE) \
117 BROTLI_DECODER ## PREFIX ## NAME = CODE
120#undef BROTLI_ERROR_CODE_ENUM_ITEM_
130#define BROTLI_LAST_ERROR_CODE BROTLI_DECODER_ERROR_UNREACHABLE
229 size_t* decoded_size,
272 size_t* available_out, uint8_t** next_out,
size_t* total_out);
405#if defined(__cplusplus) || defined(c_plusplus)
static const void * data
Definition XzCrc64.c:50
BROTLI_DEC_API uint32_t BrotliDecoderVersion(void)
Definition decode.c:3142
BROTLI_DEC_API const uint8_t * BrotliDecoderTakeOutput(BrotliDecoderState *state, size_t *size)
Definition decode.c:3078
BROTLI_DEC_API BrotliDecoderState * BrotliDecoderCreateInstance(brotli_alloc_func alloc_func, brotli_free_func free_func, void *opaque)
Definition decode.c:129
BROTLI_DEC_API const char * BrotliDecoderErrorString(BrotliDecoderErrorCode c)
Definition decode.c:3126
#define BROTLI_DECODER_ERROR_CODES_LIST(BROTLI_ERROR_CODE, SEPARATOR)
Definition decode.h:63
BROTLI_DEC_API BROTLI_BOOL BrotliDecoderHasMoreOutput(const BrotliDecoderState *state)
Definition decode.c:3067
BrotliDecoderParameter
Definition decode.h:131
@ BROTLI_DECODER_PARAM_LARGE_WINDOW
Definition decode.h:142
@ BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION
Definition decode.h:138
BrotliDecoderResult
Definition decode.h:34
@ BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT
Definition decode.h:40
@ BROTLI_DECODER_RESULT_SUCCESS
Definition decode.h:38
@ BROTLI_DECODER_RESULT_ERROR
Definition decode.h:36
@ BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT
Definition decode.h:42
BROTLI_DEC_API BrotliDecoderResult BrotliDecoderDecompress(size_t encoded_size, const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)], size_t *decoded_size, uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)])
Definition decode.c:2730
#define BROTLI_COMMA_
Definition decode.h:113
BROTLI_DEC_API BrotliDecoderResult BrotliDecoderDecompressStream(BrotliDecoderState *state, size_t *available_in, const uint8_t **next_in, size_t *available_out, uint8_t **next_out, size_t *total_out)
Definition decode.c:2501
BROTLI_DEC_API void BrotliDecoderDestroyInstance(BrotliDecoderState *state)
Definition decode.c:163
#define BROTLI_ERROR_CODE_ENUM_ITEM_(PREFIX, NAME, CODE)
Definition decode.h:114
BROTLI_DEC_API BROTLI_BOOL BrotliDecoderIsFinished(const BrotliDecoderState *state)
Definition decode.c:3115
BROTLI_DEC_API BROTLI_BOOL BrotliDecoderSetParameter(BrotliDecoderState *state, BrotliDecoderParameter param, uint32_t value)
Definition decode.c:109
BrotliDecoderErrorCode
Definition decode.h:112
BROTLI_DEC_API BROTLI_BOOL BrotliDecoderIsUsed(const BrotliDecoderState *state)
Definition decode.c:3109
BROTLI_DEC_API BrotliDecoderErrorCode BrotliDecoderGetErrorCode(const BrotliDecoderState *state)
Definition decode.c:3121
#define BROTLI_DEC_API
Definition port.h:284
#define BROTLI_ARRAY_PARAM(name)
Definition port.h:255
BROTLI_DEC_API BROTLI_BOOL BrotliDecoderAttachDictionary(BrotliDecoderState *state, BrotliSharedDictionaryType type, size_t data_size, const uint8_t data[BROTLI_ARRAY_PARAM(data_size)])
Definition decode.c:1872
void(* brotli_decoder_metadata_chunk_func)(void *opaque, const uint8_t *data, size_t size)
Definition decode.h:388
void(* brotli_decoder_metadata_start_func)(void *opaque, size_t size)
Definition decode.h:374
BROTLI_DEC_API void BrotliDecoderSetMetadataCallbacks(BrotliDecoderState *state, brotli_decoder_metadata_start_func start_func, brotli_decoder_metadata_chunk_func chunk_func, void *opaque)
Definition decode.c:3427
BrotliSharedDictionaryType
Definition shared_dictionary.h:35
BrotliRunningState state
Definition state.h:237
brotli_free_func free_func
Definition state.h:245
brotli_alloc_func alloc_func
Definition state.h:244
Definition poolTests.c:28
void *(* brotli_alloc_func)(void *opaque, size_t size)
Definition types.h:71
void(* brotli_free_func)(void *opaque, void *address)
Definition types.h:81
#define BROTLI_BOOL
Definition types.h:49
#define c(i)
Definition sha256.c:43