Path: blob/master/thirdparty/brotli/common/shared_dictionary_internal.h
9906 views
/* Copyright 2017 Google Inc. All Rights Reserved.12Distributed under MIT license.3See file LICENSE for detail or copy at https://opensource.org/licenses/MIT4*/56/* (Transparent) Shared Dictionary definition. */78#ifndef BROTLI_COMMON_SHARED_DICTIONARY_INTERNAL_H_9#define BROTLI_COMMON_SHARED_DICTIONARY_INTERNAL_H_1011#include <brotli/shared_dictionary.h>12#include <brotli/types.h>1314#include "dictionary.h"15#include "transform.h"1617#if defined(__cplusplus) || defined(c_plusplus)18extern "C" {19#endif2021struct BrotliSharedDictionaryStruct {22/* LZ77 prefixes (compound dictionary). */23uint32_t num_prefix; /* max SHARED_BROTLI_MAX_COMPOUND_DICTS */24size_t prefix_size[SHARED_BROTLI_MAX_COMPOUND_DICTS];25const uint8_t* prefix[SHARED_BROTLI_MAX_COMPOUND_DICTS];2627/* If set, the context map is used to select word and transform list from 6428contexts, if not set, the context map is not used and only words[0] and29transforms[0] are to be used. */30BROTLI_BOOL context_based;3132uint8_t context_map[SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS];3334/* Amount of word_list+transform_list combinations. */35uint8_t num_dictionaries;3637/* Must use num_dictionaries values. */38const BrotliDictionary* words[SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS];3940/* Must use num_dictionaries values. */41const BrotliTransforms* transforms[SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS];4243/* Amount of custom word lists. May be 0 if only Brotli's built-in is used */44uint8_t num_word_lists;4546/* Contents of the custom words lists. Must be NULL if num_word_lists is 0. */47BrotliDictionary* words_instances;4849/* Amount of custom transform lists. May be 0 if only Brotli's built-in is50used */51uint8_t num_transform_lists;5253/* Contents of the custom transform lists. Must be NULL if num_transform_lists54is 0. */55BrotliTransforms* transforms_instances;5657/* Concatenated prefix_suffix_maps of the custom transform lists. Must be NULL58if num_transform_lists is 0. */59uint16_t* prefix_suffix_maps;6061/* Memory management */62brotli_alloc_func alloc_func;63brotli_free_func free_func;64void* memory_manager_opaque;65};6667typedef struct BrotliSharedDictionaryStruct BrotliSharedDictionaryInternal;68#define BrotliSharedDictionary BrotliSharedDictionaryInternal6970#if defined(__cplusplus) || defined(c_plusplus)71} /* extern "C" */72#endif7374#endif /* BROTLI_COMMON_SHARED_DICTIONARY_INTERNAL_H_ */757677