| 1 | /* transforms is a part of ABI, but not API. |
| 2 | |
| 3 | It means that there are some functions that are supposed to be in "common" |
| 4 | library, but header itself is not placed into include/brotli. This way, |
| 5 | aforementioned functions will be available only to brotli internals. |
| 6 | */ |
| 7 | |
| 8 | #ifndef BROTLI_COMMON_TRANSFORM_H_ |
| 9 | #define BROTLI_COMMON_TRANSFORM_H_cxx . . $ `c/common/transform.h:9:9`! |
| 10 | |
| 11 | #include "platform.h"cxx . . $ `<file>/c/common/platform.h`/ |
| 12 | |
| 13 | #if defined(__cplusplus) || defined(c_plusplus) |
| 14 | extern "C" { |
| 15 | #endif |
| 16 | |
| 17 | enum BrotliWordTransformTypecxx . . $ BrotliWordTransformType# { |
| 18 | BROTLI_TRANSFORM_IDENTITYcxx . . $ BROTLI_TRANSFORM_IDENTITY. = 0, |
| 19 | BROTLI_TRANSFORM_OMIT_LAST_1cxx . . $ BROTLI_TRANSFORM_OMIT_LAST_1. = 1, |
| 20 | BROTLI_TRANSFORM_OMIT_LAST_2cxx . . $ BROTLI_TRANSFORM_OMIT_LAST_2. = 2, |
| 21 | BROTLI_TRANSFORM_OMIT_LAST_3cxx . . $ BROTLI_TRANSFORM_OMIT_LAST_3. = 3, |
| 22 | BROTLI_TRANSFORM_OMIT_LAST_4cxx . . $ BROTLI_TRANSFORM_OMIT_LAST_4. = 4, |
| 23 | BROTLI_TRANSFORM_OMIT_LAST_5cxx . . $ BROTLI_TRANSFORM_OMIT_LAST_5. = 5, |
| 24 | BROTLI_TRANSFORM_OMIT_LAST_6cxx . . $ BROTLI_TRANSFORM_OMIT_LAST_6. = 6, |
| 25 | BROTLI_TRANSFORM_OMIT_LAST_7cxx . . $ BROTLI_TRANSFORM_OMIT_LAST_7. = 7, |
| 26 | BROTLI_TRANSFORM_OMIT_LAST_8cxx . . $ BROTLI_TRANSFORM_OMIT_LAST_8. = 8, |
| 27 | BROTLI_TRANSFORM_OMIT_LAST_9cxx . . $ BROTLI_TRANSFORM_OMIT_LAST_9. = 9, |
| 28 | BROTLI_TRANSFORM_UPPERCASE_FIRSTcxx . . $ BROTLI_TRANSFORM_UPPERCASE_FIRST. = 10, |
| 29 | BROTLI_TRANSFORM_UPPERCASE_ALLcxx . . $ BROTLI_TRANSFORM_UPPERCASE_ALL. = 11, |
| 30 | BROTLI_TRANSFORM_OMIT_FIRST_1cxx . . $ BROTLI_TRANSFORM_OMIT_FIRST_1. = 12, |
| 31 | BROTLI_TRANSFORM_OMIT_FIRST_2cxx . . $ BROTLI_TRANSFORM_OMIT_FIRST_2. = 13, |
| 32 | BROTLI_TRANSFORM_OMIT_FIRST_3cxx . . $ BROTLI_TRANSFORM_OMIT_FIRST_3. = 14, |
| 33 | BROTLI_TRANSFORM_OMIT_FIRST_4cxx . . $ BROTLI_TRANSFORM_OMIT_FIRST_4. = 15, |
| 34 | BROTLI_TRANSFORM_OMIT_FIRST_5cxx . . $ BROTLI_TRANSFORM_OMIT_FIRST_5. = 16, |
| 35 | BROTLI_TRANSFORM_OMIT_FIRST_6cxx . . $ BROTLI_TRANSFORM_OMIT_FIRST_6. = 17, |
| 36 | BROTLI_TRANSFORM_OMIT_FIRST_7cxx . . $ BROTLI_TRANSFORM_OMIT_FIRST_7. = 18, |
| 37 | BROTLI_TRANSFORM_OMIT_FIRST_8cxx . . $ BROTLI_TRANSFORM_OMIT_FIRST_8. = 19, |
| 38 | BROTLI_TRANSFORM_OMIT_FIRST_9cxx . . $ BROTLI_TRANSFORM_OMIT_FIRST_9. = 20, |
| 39 | BROTLI_TRANSFORM_SHIFT_FIRSTcxx . . $ BROTLI_TRANSFORM_SHIFT_FIRST. = 21, |
| 40 | BROTLI_TRANSFORM_SHIFT_ALLcxx . . $ BROTLI_TRANSFORM_SHIFT_ALL. = 22, |
| 41 | BROTLI_NUM_TRANSFORM_TYPEScxx . . $ BROTLI_NUM_TRANSFORM_TYPES. /* Counts transforms, not a transform itself. */ |
| 42 | }; |
| 43 | |
| 44 | #define BROTLI_TRANSFORMS_MAX_CUT_OFFcxx . . $ `c/common/transform.h:44:9`! BROTLI_TRANSFORM_OMIT_LAST_9 |
| 45 | |
| 46 | typedef struct BrotliTransformscxx . . $ BrotliTransforms# { |
| 47 | uint16_tcxx . . $ uint16_t# prefix_suffix_sizecxx . . $ BrotliTransforms#prefix_suffix_size.; |
| 48 | /* Last character must be null, so prefix_suffix_size must be at least 1. */ |
| 49 | const uint8_tcxx . . $ uint8_t#* prefix_suffixcxx . . $ BrotliTransforms#prefix_suffix.; |
| 50 | const uint16_tcxx . . $ uint16_t#* prefix_suffix_mapcxx . . $ BrotliTransforms#prefix_suffix_map.; |
| 51 | uint32_tcxx . . $ uint32_t# num_transformscxx . . $ BrotliTransforms#num_transforms.; |
| 52 | /* Each entry is a [prefix_id, transform, suffix_id] triplet. */ |
| 53 | const uint8_tcxx . . $ uint8_t#* transformscxx . . $ BrotliTransforms#transforms.; |
| 54 | /* Shift for BROTLI_TRANSFORM_SHIFT_FIRST and BROTLI_TRANSFORM_SHIFT_ALL, |
| 55 | must be NULL if and only if no such transforms are present. */ |
| 56 | const uint8_tcxx . . $ uint8_t#* paramscxx . . $ BrotliTransforms#params.; |
| 57 | /* Indices of transforms like ["", BROTLI_TRANSFORM_OMIT_LAST_#, ""]. |
| 58 | 0-th element corresponds to ["", BROTLI_TRANSFORM_IDENTITY, ""]. |
| 59 | -1, if cut-off transform does not exist. */ |
| 60 | int16_tcxx . . $ int16_t# cutOffTransformscxx . . $ BrotliTransforms#cutOffTransforms.[BROTLI_TRANSFORMS_MAX_CUT_OFFcxx . . $ `c/common/transform.h:44:9`! + 1]; |
| 61 | } BrotliTransformscxx . . $ BrotliTransforms#; |
| 62 | |
| 63 | /* T is BrotliTransforms*; result is uint8_t. */ |
| 64 | #define BROTLI_TRANSFORM_PREFIX_IDcxx . . $ `c/common/transform.h:64:9`!(T, I) ((T)->transforms[((I) * 3) + 0]) |
| 65 | #define BROTLI_TRANSFORM_TYPEcxx . . $ `c/common/transform.h:65:9`!(T, I) ((T)->transforms[((I) * 3) + 1]) |
| 66 | #define BROTLI_TRANSFORM_SUFFIX_IDcxx . . $ `c/common/transform.h:66:9`!(T, I) ((T)->transforms[((I) * 3) + 2]) |
| 67 | |
| 68 | /* T is BrotliTransforms*; result is const uint8_t*. */ |
| 69 | #define BROTLI_TRANSFORM_PREFIXcxx . . $ `c/common/transform.h:69:9`!(T, I) (&(T)->prefix_suffix[ \ |
| 70 | (T)->prefix_suffix_map[BROTLI_TRANSFORM_PREFIX_ID(T, I)]]) |
| 71 | #define BROTLI_TRANSFORM_SUFFIXcxx . . $ `c/common/transform.h:71:9`!(T, I) (&(T)->prefix_suffix[ \ |
| 72 | (T)->prefix_suffix_map[BROTLI_TRANSFORM_SUFFIX_ID(T, I)]]) |
| 73 | |
| 74 | BROTLI_COMMON_APIcxx . . $ `c/include/brotli/port.h:286:9`! const BrotliTransformscxx . . $ BrotliTransforms#* BrotliGetTransformscxx . . $ BrotliGetTransforms(681a590e19c70e53).(void); |
| 75 | |
| 76 | BROTLI_COMMON_APIcxx . . $ `c/include/brotli/port.h:286:9`! int BrotliTransformDictionaryWordcxx . . $ BrotliTransformDictionaryWord(1ae3c5f2aac46052).( |
| 77 | uint8_tcxx . . $ uint8_t#* dst, const uint8_tcxx . . $ uint8_t#* word, int len, |
| 78 | const BrotliTransformscxx . . $ BrotliTransforms#* transforms, int transform_idx); |
| 79 | |
| 80 | #if defined(__cplusplus) || defined(c_plusplus) |
| 81 | } /* extern "C" */ |
| 82 | #endif |
| 83 | |
| 84 | #endif /* BROTLI_COMMON_TRANSFORM_H_ */ |