Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
shared_dictionary.c File Reference
#include <brotli/shared_dictionary.h>
#include <memory.h>
#include <stdlib.h>
#include <stdio.h>
#include "dictionary.h"
#include "platform.h"
#include "shared_dictionary_internal.h"

Functions

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

Function Documentation

◆ BrotliSharedDictionaryAttach()

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()

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()

void BrotliSharedDictionaryDestroyInstance ( BrotliSharedDictionary * dict)

Deinitializes and frees BrotliSharedDictionary instance.

Parameters
dictshared dictionary instance to be cleaned up and deallocated