Path: blob/master/thirdparty/brotli/common/dictionary.c
21677 views
/* Copyright 2013 Google Inc. All Rights Reserved.12Distributed under MIT license.3See file LICENSE for detail or copy at https://opensource.org/licenses/MIT4*/56#include "dictionary.h"7#include "platform.h"89#if defined(__cplusplus) || defined(c_plusplus)10extern "C" {11#endif1213#if !defined(BROTLI_EXTERNAL_DICTIONARY_DATA)14/* Embed kBrotliDictionaryData */15#include "dictionary_inc.h"16static const BROTLI_MODEL("small") BrotliDictionary kBrotliDictionary = {17#else18static BROTLI_MODEL("small") BrotliDictionary kBrotliDictionary = {19#endif20/* size_bits_by_length */21{220, 0, 0, 0, 10, 10, 11, 11,2310, 10, 10, 10, 10, 9, 9, 8,247, 7, 8, 7, 7, 6, 6, 5,255, 0, 0, 0, 0, 0, 0, 026},2728/* offsets_by_length */29{300, 0, 0, 0, 0, 4096, 9216, 21504,3135840, 44032, 53248, 63488, 74752, 87040, 93696, 100864,32104704, 106752, 108928, 113536, 115968, 118528, 119872, 121280,33122016, 122784, 122784, 122784, 122784, 122784, 122784, 12278434},3536/* data_size == sizeof(kBrotliDictionaryData) */37122784,3839/* data */40#if defined(BROTLI_EXTERNAL_DICTIONARY_DATA)41NULL42#else43kBrotliDictionaryData44#endif45};4647const BrotliDictionary* BrotliGetDictionary(void) {48return &kBrotliDictionary;49}5051void BrotliSetDictionaryData(const uint8_t* data) {52#if defined(BROTLI_EXTERNAL_DICTIONARY_DATA)53if (!!data && !kBrotliDictionary.data) {54kBrotliDictionary.data = data;55}56#else57BROTLI_UNUSED(data); // Appease -Werror=unused-parameter58#endif59}6061#if defined(__cplusplus) || defined(c_plusplus)62} /* extern "C" */63#endif646566