#include <brotli/port.h>
#include <brotli/types.h>
Go to the source code of this file.
◆ 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 |
◆ BrotliSharedDictionaryType
◆ 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.
|
◆ BrotliSharedDictionaryAttach()
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
-
dict | dictionary to extend |
type | type of dictionary to attach |
data_size | size of data |
data | serialized dictionary of type type , with at least data_size addressable bytes |
- Returns
- BROTLI_TRUE if provided dictionary is successfully attached
-
BROTLI_FALSE otherwise
◆ BrotliSharedDictionaryCreateInstance()
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_func | custom memory allocation function |
free_func | custom memory free function |
opaque | custom memory manager handle |
- Returns
0
if instance can not be allocated or initialized
-
pointer to initialized BrotliSharedDictionary otherwise
◆ BrotliSharedDictionaryDestroyInstance()
Deinitializes and frees BrotliSharedDictionary instance.
- Parameters
-
dict | shared dictionary instance to be cleaned up and deallocated |