webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Macros | Functions
decode.c File Reference
#include "./decode.h"
#include <stdlib.h>
#include <string.h>
#include "./bit_reader.h"
#include "./context.h"
#include "./dictionary.h"
#include "./huffman.h"
#include "./port.h"
#include "./prefix.h"
#include "./state.h"
#include "./transform.h"

Macros

#define BROTLI_FAILURE(CODE)   (BROTLI_DUMP(), CODE)
 
#define BROTLI_LOG_UINT(name)   BROTLI_LOG(("[%s] %s = %lu\n", __func__, #name, (unsigned long)(name)))
 
#define BROTLI_LOG_ARRAY_INDEX(array_name, idx)
 
#define HUFFMAN_TABLE_BITS   8U
 
#define HUFFMAN_TABLE_MASK   0xff
 
#define CODE_LENGTH_CODES   18
 
#define NUM_DISTANCE_SHORT_CODES   16
 
#define BROTLI_SAFE(METHOD)
 
#define _BROTLI_ERROR_CODE_CASE(PREFIX, NAME, CODE)   case BROTLI ## PREFIX ## NAME: return #NAME;
 
#define _BROTLI_NOTHING
 

Functions

BrotliStateBrotliCreateState (brotli_alloc_func alloc_func, brotli_free_func free_func, void *opaque)
 
void BrotliDestroyState (BrotliState *state)
 
int BrotliDecompressedSize (size_t encoded_size, const uint8_t *encoded_buffer, size_t *decoded_size)
 
BrotliResult BrotliDecompressBuffer (size_t encoded_size, const uint8_t *encoded_buffer, size_t *decoded_size, uint8_t *decoded_buffer)
 
BrotliResult BrotliDecompressStream (size_t *available_in, const uint8_t **next_in, size_t *available_out, uint8_t **next_out, size_t *total_out, BrotliState *s)
 
void BrotliSetCustomDictionary (size_t size, const uint8_t *dict, BrotliState *s)
 
BrotliErrorCode BrotliGetErrorCode (const BrotliState *s)
 
const char * BrotliErrorString (BrotliErrorCode c)
 

Macro Definition Documentation

◆ _BROTLI_ERROR_CODE_CASE

#define _BROTLI_ERROR_CODE_CASE (   PREFIX,
  NAME,
  CODE 
)    case BROTLI ## PREFIX ## NAME: return #NAME;

◆ _BROTLI_NOTHING

#define _BROTLI_NOTHING

◆ BROTLI_FAILURE

#define BROTLI_FAILURE (   CODE)    (BROTLI_DUMP(), CODE)

◆ BROTLI_LOG_ARRAY_INDEX

#define BROTLI_LOG_ARRAY_INDEX (   array_name,
  idx 
)
Value:
BROTLI_LOG(("[%s] %s[%lu] = %lu\n", __func__, #array_name, \
(unsigned long)(idx), (unsigned long)array_name[idx]))
#define BROTLI_LOG(x)
Definition: port.h:165

◆ BROTLI_LOG_UINT

#define BROTLI_LOG_UINT (   name)    BROTLI_LOG(("[%s] %s = %lu\n", __func__, #name, (unsigned long)(name)))

◆ BROTLI_SAFE

#define BROTLI_SAFE (   METHOD)
Value:
{ \
if (safe) { \
if (!Safe##METHOD) { \
result = BROTLI_NEEDS_MORE_INPUT; \
goto saveStateAndReturn; \
} \
} else { \
METHOD; \
} \
}

◆ CODE_LENGTH_CODES

#define CODE_LENGTH_CODES   18

◆ HUFFMAN_TABLE_BITS

#define HUFFMAN_TABLE_BITS   8U

◆ HUFFMAN_TABLE_MASK

#define HUFFMAN_TABLE_MASK   0xff

◆ NUM_DISTANCE_SHORT_CODES

#define NUM_DISTANCE_SHORT_CODES   16

Function Documentation

◆ BrotliCreateState()

BrotliState* BrotliCreateState ( brotli_alloc_func  alloc_func,
brotli_free_func  free_func,
void opaque 
)

◆ BrotliDecompressBuffer()

BrotliResult BrotliDecompressBuffer ( size_t  encoded_size,
const uint8_t encoded_buffer,
size_t decoded_size,
uint8_t decoded_buffer 
)

◆ BrotliDecompressedSize()

int BrotliDecompressedSize ( size_t  encoded_size,
const uint8_t encoded_buffer,
size_t decoded_size 
)

◆ BrotliDecompressStream()

BrotliResult BrotliDecompressStream ( size_t available_in,
const uint8_t **  next_in,
size_t available_out,
uint8_t **  next_out,
size_t total_out,
BrotliState s 
)

◆ BrotliDestroyState()

void BrotliDestroyState ( BrotliState state)

◆ BrotliErrorString()

const char* BrotliErrorString ( BrotliErrorCode  c)

◆ BrotliGetErrorCode()

BrotliErrorCode BrotliGetErrorCode ( const BrotliState s)

◆ BrotliSetCustomDictionary()

void BrotliSetCustomDictionary ( size_t  size,
const uint8_t dict,
BrotliState s 
)