| 1 | /* Copyright 2017 Google Inc. All Rights Reserved. |
| 2 | |
| 3 | Distributed under MIT license. |
| 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT |
| 5 | */ |
| 6 | |
| 7 | /* (Transparent) Shared Dictionary definition. */ |
| 8 | |
| 9 | #ifndef BROTLI_COMMON_SHARED_DICTIONARY_INTERNAL_H_ |
| 10 | #define BROTLI_COMMON_SHARED_DICTIONARY_INTERNAL_H_cxx . . $ `c/common/shared_dictionary_internal.h:10:9`! |
| 11 | |
| 12 | #include <brotli/shared_dictionary.h>cxx . . $ `<file>/c/include/brotli/shared_dictionary.h`/ |
| 13 | |
| 14 | #include "dictionary.h"cxx . . $ `<file>/c/common/dictionary.h`/ |
| 15 | #include "platform.h"cxx . . $ `<file>/c/common/platform.h`/ |
| 16 | #include "transform.h"cxx . . $ `<file>/c/common/transform.h`/ |
| 17 | |
| 18 | #if defined(__cplusplus) || defined(c_plusplus) |
| 19 | extern "C" { |
| 20 | #endif |
| 21 | |
| 22 | struct BrotliSharedDictionaryStructcxx . . $ BrotliSharedDictionaryStruct# { |
| 23 | /* LZ77 prefixes (compound dictionary). */ |
| 24 | uint32_tcxx . . $ uint32_t# num_prefixcxx . . $ BrotliSharedDictionaryStruct#num_prefix.; /* max SHARED_BROTLI_MAX_COMPOUND_DICTS */ |
| 25 | size_t prefix_sizecxx . . $ BrotliSharedDictionaryStruct#prefix_size.[SHARED_BROTLI_MAX_COMPOUND_DICTScxx . . $ `c/include/brotli/shared_dictionary.h:22:9`!]; |
| 26 | const uint8_tcxx . . $ uint8_t#* prefixcxx . . $ BrotliSharedDictionaryStruct#prefix.[SHARED_BROTLI_MAX_COMPOUND_DICTScxx . . $ `c/include/brotli/shared_dictionary.h:22:9`!]; |
| 27 | |
| 28 | /* If set, the context map is used to select word and transform list from 64 |
| 29 | contexts, if not set, the context map is not used and only words[0] and |
| 30 | transforms[0] are to be used. */ |
| 31 | BROTLI_BOOLcxx . . $ `c/include/brotli/types.h:49:9`! context_basedcxx . . $ BrotliSharedDictionaryStruct#context_based.; |
| 32 | |
| 33 | uint8_tcxx . . $ uint8_t# context_mapcxx . . $ BrotliSharedDictionaryStruct#context_map.[SHARED_BROTLI_NUM_DICTIONARY_CONTEXTScxx . . $ `c/include/brotli/shared_dictionary.h:21:9`!]; |
| 34 | |
| 35 | /* Amount of word_list+transform_list combinations. */ |
| 36 | uint8_tcxx . . $ uint8_t# num_dictionariescxx . . $ BrotliSharedDictionaryStruct#num_dictionaries.; |
| 37 | |
| 38 | /* Must use num_dictionaries values. */ |
| 39 | const BrotliDictionarycxx . . $ BrotliDictionary#* wordscxx . . $ BrotliSharedDictionaryStruct#words.[SHARED_BROTLI_NUM_DICTIONARY_CONTEXTScxx . . $ `c/include/brotli/shared_dictionary.h:21:9`!]; |
| 40 | |
| 41 | /* Must use num_dictionaries values. */ |
| 42 | const BrotliTransformscxx . . $ BrotliTransforms#* transformscxx . . $ BrotliSharedDictionaryStruct#transforms.[SHARED_BROTLI_NUM_DICTIONARY_CONTEXTScxx . . $ `c/include/brotli/shared_dictionary.h:21:9`!]; |
| 43 | |
| 44 | /* Amount of custom word lists. May be 0 if only Brotli's built-in is used */ |
| 45 | uint8_tcxx . . $ uint8_t# num_word_listscxx . . $ BrotliSharedDictionaryStruct#num_word_lists.; |
| 46 | |
| 47 | /* Contents of the custom words lists. Must be NULL if num_word_lists is 0. */ |
| 48 | BrotliDictionarycxx . . $ BrotliDictionary#* words_instancescxx . . $ BrotliSharedDictionaryStruct#words_instances.; |
| 49 | |
| 50 | /* Amount of custom transform lists. May be 0 if only Brotli's built-in is |
| 51 | used */ |
| 52 | uint8_tcxx . . $ uint8_t# num_transform_listscxx . . $ BrotliSharedDictionaryStruct#num_transform_lists.; |
| 53 | |
| 54 | /* Contents of the custom transform lists. Must be NULL if num_transform_lists |
| 55 | is 0. */ |
| 56 | BrotliTransformscxx . . $ BrotliTransforms#* transforms_instancescxx . . $ BrotliSharedDictionaryStruct#transforms_instances.; |
| 57 | |
| 58 | /* Concatenated prefix_suffix_maps of the custom transform lists. Must be NULL |
| 59 | if num_transform_lists is 0. */ |
| 60 | uint16_tcxx . . $ uint16_t#* prefix_suffix_mapscxx . . $ BrotliSharedDictionaryStruct#prefix_suffix_maps.; |
| 61 | |
| 62 | /* Memory management */ |
| 63 | brotli_alloc_funccxx . . $ brotli_alloc_func# alloc_funccxx . . $ BrotliSharedDictionaryStruct#alloc_func.; |
| 64 | brotli_free_funccxx . . $ brotli_free_func# free_funccxx . . $ BrotliSharedDictionaryStruct#free_func.; |
| 65 | void* memory_manager_opaquecxx . . $ BrotliSharedDictionaryStruct#memory_manager_opaque.; |
| 66 | }; |
| 67 | |
| 68 | typedef struct BrotliSharedDictionaryStructcxx . . $ BrotliSharedDictionaryStruct# BrotliSharedDictionaryInternalcxx . . $ BrotliSharedDictionaryInternal#; |
| 69 | #define BrotliSharedDictionarycxx . . $ `c/common/shared_dictionary_internal.h:69:9`! BrotliSharedDictionaryInternal |
| 70 | |
| 71 | #if defined(__cplusplus) || defined(c_plusplus) |
| 72 | } /* extern "C" */ |
| 73 | #endif |
| 74 | |
| 75 | #endif /* BROTLI_COMMON_SHARED_DICTIONARY_INTERNAL_H_ */ |