Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
transform.h
Go to the documentation of this file.
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_
10
11#include <brotli/port.h>
12#include <brotli/types.h>
13
14#if defined(__cplusplus) || defined(c_plusplus)
15extern "C" {
16#endif
17
44
45#define BROTLI_TRANSFORMS_MAX_CUT_OFF BROTLI_TRANSFORM_OMIT_LAST_9
46
47typedef struct BrotliTransforms {
49 /* Last character must be null, so prefix_suffix_size must be at least 1. */
50 const uint8_t* prefix_suffix;
51 const uint16_t* prefix_suffix_map;
53 /* Each entry is a [prefix_id, transform, suffix_id] triplet. */
54 const uint8_t* transforms;
55 /* Shift for BROTLI_TRANSFORM_SHIFT_FIRST and BROTLI_TRANSFORM_SHIFT_ALL,
56 must be NULL if and only if no such transforms are present. */
57 const uint8_t* params;
58 /* Indices of transforms like ["", BROTLI_TRANSFORM_OMIT_LAST_#, ""].
59 0-th element corresponds to ["", BROTLI_TRANSFORM_IDENTITY, ""].
60 -1, if cut-off transform does not exist. */
63
64/* T is BrotliTransforms*; result is uint8_t. */
65#define BROTLI_TRANSFORM_PREFIX_ID(T, I) ((T)->transforms[((I) * 3) + 0])
66#define BROTLI_TRANSFORM_TYPE(T, I) ((T)->transforms[((I) * 3) + 1])
67#define BROTLI_TRANSFORM_SUFFIX_ID(T, I) ((T)->transforms[((I) * 3) + 2])
68
69/* T is BrotliTransforms*; result is const uint8_t*. */
70#define BROTLI_TRANSFORM_PREFIX(T, I) (&(T)->prefix_suffix[ \
71 (T)->prefix_suffix_map[BROTLI_TRANSFORM_PREFIX_ID(T, I)]])
72#define BROTLI_TRANSFORM_SUFFIX(T, I) (&(T)->prefix_suffix[ \
73 (T)->prefix_suffix_map[BROTLI_TRANSFORM_SUFFIX_ID(T, I)]])
74
76
78 uint8_t* dst, const uint8_t* word, int len,
79 const BrotliTransforms* transforms, int transform_idx);
80
81#if defined(__cplusplus) || defined(c_plusplus)
82} /* extern "C" */
83#endif
84
85#endif /* BROTLI_COMMON_TRANSFORM_H_ */
#define BROTLI_TRANSFORMS_MAX_CUT_OFF
Definition transform.h:45
BROTLI_COMMON_API const BrotliTransforms * BrotliGetTransforms(void)
Definition transform.c:173
BROTLI_COMMON_API int BrotliTransformDictionaryWord(uint8_t *dst, const uint8_t *word, int len, const BrotliTransforms *transforms, int transform_idx)
Definition transform.c:236
BrotliWordTransformType
Definition transform.h:18
@ BROTLI_TRANSFORM_UPPERCASE_FIRST
Definition transform.h:29
@ BROTLI_TRANSFORM_OMIT_LAST_9
Definition transform.h:28
@ BROTLI_TRANSFORM_OMIT_FIRST_7
Definition transform.h:37
@ BROTLI_TRANSFORM_OMIT_FIRST_5
Definition transform.h:35
@ BROTLI_TRANSFORM_OMIT_FIRST_6
Definition transform.h:36
@ BROTLI_TRANSFORM_SHIFT_ALL
Definition transform.h:41
@ BROTLI_NUM_TRANSFORM_TYPES
Definition transform.h:42
@ BROTLI_TRANSFORM_UPPERCASE_ALL
Definition transform.h:30
@ BROTLI_TRANSFORM_OMIT_LAST_3
Definition transform.h:22
@ BROTLI_TRANSFORM_OMIT_FIRST_2
Definition transform.h:32
@ BROTLI_TRANSFORM_OMIT_LAST_5
Definition transform.h:24
@ BROTLI_TRANSFORM_OMIT_LAST_7
Definition transform.h:26
@ BROTLI_TRANSFORM_OMIT_LAST_4
Definition transform.h:23
@ BROTLI_TRANSFORM_OMIT_LAST_6
Definition transform.h:25
@ BROTLI_TRANSFORM_OMIT_LAST_1
Definition transform.h:20
@ BROTLI_TRANSFORM_SHIFT_FIRST
Definition transform.h:40
@ BROTLI_TRANSFORM_IDENTITY
Definition transform.h:19
@ BROTLI_TRANSFORM_OMIT_FIRST_4
Definition transform.h:34
@ BROTLI_TRANSFORM_OMIT_FIRST_8
Definition transform.h:38
@ BROTLI_TRANSFORM_OMIT_FIRST_9
Definition transform.h:39
@ BROTLI_TRANSFORM_OMIT_LAST_2
Definition transform.h:21
@ BROTLI_TRANSFORM_OMIT_FIRST_3
Definition transform.h:33
@ BROTLI_TRANSFORM_OMIT_FIRST_1
Definition transform.h:31
@ BROTLI_TRANSFORM_OMIT_LAST_8
Definition transform.h:27
struct BrotliTransforms BrotliTransforms
#define BROTLI_COMMON_API
Definition port.h:283
char * dst
Definition lz4.h:833
Definition transform.h:47
const uint16_t * prefix_suffix_map
Definition transform.h:51
const uint8_t * prefix_suffix
Definition transform.h:50
int16_t cutOffTransforms[BROTLI_TRANSFORMS_MAX_CUT_OFF+1]
Definition transform.h:61
uint16_t prefix_suffix_size
Definition transform.h:48
const uint8_t * params
Definition transform.h:57
uint32_t num_transforms
Definition transform.h:52
const uint8_t * transforms
Definition transform.h:54
static uint32_t const uint8_t uint32_t len
Definition memcmplen.h:44