Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
shared_dictionary.h File Reference
#include <brotli/port.h>
#include <brotli/types.h>

Go to the source code of this file.

Macros

#define SHARED_BROTLI_MIN_DICTIONARY_WORD_LENGTH   4
 
#define SHARED_BROTLI_MAX_DICTIONARY_WORD_LENGTH   31
 
#define SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS   64
 
#define SHARED_BROTLI_MAX_COMPOUND_DICTS   15
 

Typedefs

typedef enum BrotliSharedDictionaryType BrotliSharedDictionaryType
 

Enumerations

enum  BrotliSharedDictionaryType { BROTLI_SHARED_DICTIONARY_RAW = 0 , BROTLI_SHARED_DICTIONARY_SERIALIZED = 1 }
 

Functions

BROTLI_COMMON_API BrotliSharedDictionaryBrotliSharedDictionaryCreateInstance (brotli_alloc_func alloc_func, brotli_free_func free_func, void *opaque)
 
BROTLI_COMMON_API void BrotliSharedDictionaryDestroyInstance (BrotliSharedDictionary *dict)
 
BROTLI_COMMON_API BROTLI_BOOL BrotliSharedDictionaryAttach (BrotliSharedDictionary *dict, BrotliSharedDictionaryType type, size_t data_size, const uint8_t data[BROTLI_ARRAY_PARAM(data_size)])
 

Macro Definition Documentation

◆ SHARED_BROTLI_MAX_COMPOUND_DICTS

#define SHARED_BROTLI_MAX_COMPOUND_DICTS   15

◆ SHARED_BROTLI_MAX_DICTIONARY_WORD_LENGTH

#define SHARED_BROTLI_MAX_DICTIONARY_WORD_LENGTH   31

◆ SHARED_BROTLI_MIN_DICTIONARY_WORD_LENGTH

#define SHARED_BROTLI_MIN_DICTIONARY_WORD_LENGTH   4

◆ SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS

#define SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS   64

Typedef Documentation

◆ BrotliSharedDictionaryType

Enumeration Type Documentation

◆ BrotliSharedDictionaryType

Input data type for BrotliSharedDictionaryAttach.

Enumerator
BROTLI_SHARED_DICTIONARY_RAW 

Raw LZ77 prefix dictionary.

BROTLI_SHARED_DICTIONARY_SERIALIZED 

Serialized shared dictionary.

DO NOT USE: methods accepting this value will fail.

Function Documentation

◆ BrotliSharedDictionaryAttach()

BROTLI_COMMON_API BROTLI_BOOL BrotliSharedDictionaryAttach ( BrotliSharedDictionary * dict,
BrotliSharedDictionaryType type,
size_t data_size,
const uint8_t data[BROTLI_ARRAY_PARAM(data_size)] )

Attaches dictionary to a given instance of BrotliSharedDictionary.

Dictionary to be attached is represented in a serialized format as a region of memory.

Provided data it partially referenced by a resulting (compound) dictionary, and should be kept untouched, while at least one compound dictionary uses it. This way memory overhead is kept minimal by the cost of additional resource management.

Parameters
dictdictionary to extend
typetype of dictionary to attach
data_sizesize of data
dataserialized dictionary of type type, with at least data_size addressable bytes
Returns
BROTLI_TRUE if provided dictionary is successfully attached
BROTLI_FALSE otherwise

◆ BrotliSharedDictionaryCreateInstance()

BROTLI_COMMON_API BrotliSharedDictionary * BrotliSharedDictionaryCreateInstance ( brotli_alloc_func alloc_func,
brotli_free_func free_func,
void * opaque )

Creates an instance of BrotliSharedDictionary.

Fresh instance has default word dictionary and transforms and no LZ77 prefix dictionary.

alloc_func and free_func MUST be both zero or both non-zero. In the case they are both zero, default memory allocators are used. opaque is passed to alloc_func and free_func when they are called. free_func has to return without doing anything when asked to free a NULL pointer.

Parameters
alloc_funccustom memory allocation function
free_funccustom memory free function
opaquecustom memory manager handle
Returns
0 if instance can not be allocated or initialized
pointer to initialized BrotliSharedDictionary otherwise

◆ BrotliSharedDictionaryDestroyInstance()

BROTLI_COMMON_API void BrotliSharedDictionaryDestroyInstance ( BrotliSharedDictionary * dict)

Deinitializes and frees BrotliSharedDictionary instance.

Parameters
dictshared dictionary instance to be cleaned up and deallocated