Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
decode.h
Go to the documentation of this file.
1/* Copyright 2013 Google Inc. All Rights Reserved.
2
3 Distributed under MIT license.
4 See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
5*/
6
12#ifndef BROTLI_DEC_DECODE_H_
13#define BROTLI_DEC_DECODE_H_
14
15#include <brotli/port.h>
16#include <brotli/types.h>
17
18#if defined(__cplusplus) || defined(c_plusplus)
19extern "C" {
20#endif
21
29
44
63#define BROTLI_DECODER_ERROR_CODES_LIST(BROTLI_ERROR_CODE, SEPARATOR) \
64 BROTLI_ERROR_CODE(_, NO_ERROR, 0) SEPARATOR \
65 /* Same as BrotliDecoderResult values */ \
66 BROTLI_ERROR_CODE(_, SUCCESS, 1) SEPARATOR \
67 BROTLI_ERROR_CODE(_, NEEDS_MORE_INPUT, 2) SEPARATOR \
68 BROTLI_ERROR_CODE(_, NEEDS_MORE_OUTPUT, 3) SEPARATOR \
69 \
70 /* Errors caused by invalid input */ \
71 BROTLI_ERROR_CODE(_ERROR_FORMAT_, EXUBERANT_NIBBLE, -1) SEPARATOR \
72 BROTLI_ERROR_CODE(_ERROR_FORMAT_, RESERVED, -2) SEPARATOR \
73 BROTLI_ERROR_CODE(_ERROR_FORMAT_, EXUBERANT_META_NIBBLE, -3) SEPARATOR \
74 BROTLI_ERROR_CODE(_ERROR_FORMAT_, SIMPLE_HUFFMAN_ALPHABET, -4) SEPARATOR \
75 BROTLI_ERROR_CODE(_ERROR_FORMAT_, SIMPLE_HUFFMAN_SAME, -5) SEPARATOR \
76 BROTLI_ERROR_CODE(_ERROR_FORMAT_, CL_SPACE, -6) SEPARATOR \
77 BROTLI_ERROR_CODE(_ERROR_FORMAT_, HUFFMAN_SPACE, -7) SEPARATOR \
78 BROTLI_ERROR_CODE(_ERROR_FORMAT_, CONTEXT_MAP_REPEAT, -8) SEPARATOR \
79 BROTLI_ERROR_CODE(_ERROR_FORMAT_, BLOCK_LENGTH_1, -9) SEPARATOR \
80 BROTLI_ERROR_CODE(_ERROR_FORMAT_, BLOCK_LENGTH_2, -10) SEPARATOR \
81 BROTLI_ERROR_CODE(_ERROR_FORMAT_, TRANSFORM, -11) SEPARATOR \
82 BROTLI_ERROR_CODE(_ERROR_FORMAT_, DICTIONARY, -12) SEPARATOR \
83 BROTLI_ERROR_CODE(_ERROR_FORMAT_, WINDOW_BITS, -13) SEPARATOR \
84 BROTLI_ERROR_CODE(_ERROR_FORMAT_, PADDING_1, -14) SEPARATOR \
85 BROTLI_ERROR_CODE(_ERROR_FORMAT_, PADDING_2, -15) SEPARATOR \
86 BROTLI_ERROR_CODE(_ERROR_FORMAT_, DISTANCE, -16) SEPARATOR \
87 \
88 /* -17..-18 codes are reserved */ \
89 \
90 BROTLI_ERROR_CODE(_ERROR_, DICTIONARY_NOT_SET, -19) SEPARATOR \
91 BROTLI_ERROR_CODE(_ERROR_, INVALID_ARGUMENTS, -20) SEPARATOR \
92 \
93 /* Memory allocation problems */ \
94 BROTLI_ERROR_CODE(_ERROR_ALLOC_, CONTEXT_MODES, -21) SEPARATOR \
95 /* Literal, insert and distance trees together */ \
96 BROTLI_ERROR_CODE(_ERROR_ALLOC_, TREE_GROUPS, -22) SEPARATOR \
97 /* -23..-24 codes are reserved for distinct tree groups */ \
98 BROTLI_ERROR_CODE(_ERROR_ALLOC_, CONTEXT_MAP, -25) SEPARATOR \
99 BROTLI_ERROR_CODE(_ERROR_ALLOC_, RING_BUFFER_1, -26) SEPARATOR \
100 BROTLI_ERROR_CODE(_ERROR_ALLOC_, RING_BUFFER_2, -27) SEPARATOR \
101 /* -28..-29 codes are reserved for dynamic ring-buffer allocation */ \
102 BROTLI_ERROR_CODE(_ERROR_ALLOC_, BLOCK_TYPE_TREES, -30) SEPARATOR \
103 \
104 /* "Impossible" states */ \
105 BROTLI_ERROR_CODE(_ERROR_, UNREACHABLE, -31)
106
112typedef enum {
113#define BROTLI_COMMA_ ,
114#define BROTLI_ERROR_CODE_ENUM_ITEM_(PREFIX, NAME, CODE) \
115 BROTLI_DECODER ## PREFIX ## NAME = CODE
118#undef BROTLI_ERROR_CODE_ENUM_ITEM_
119#undef BROTLI_COMMA_
120
128#define BROTLI_LAST_ERROR_CODE BROTLI_DECODER_ERROR_UNREACHABLE
129
144
155 BrotliDecoderState* state, BrotliDecoderParameter param, uint32_t value);
156
177
184
203 size_t encoded_size,
204 const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
205 size_t* decoded_size,
206 uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]);
207
247 BrotliDecoderState* state, size_t* available_in, const uint8_t** next_in,
248 size_t* available_out, uint8_t** next_out, size_t* total_out);
249
259
289 BrotliDecoderState* state, size_t* size);
290
302
313
327
332
339
340#if defined(__cplusplus) || defined(c_plusplus)
341} /* extern "C" */
342#endif
343
344#endif /* BROTLI_DEC_DECODE_H_ */
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
Definition state.h:236
BrotliRunningState state
Definition state.h:237
brotli_free_func free_func
Definition state.h:245
brotli_alloc_func alloc_func
Definition state.h:244
size_t size
Definition platform.h:559
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