ReactOS 0.4.15-dev-7674-gc0b4db1
zstd_ddict.h File Reference
#include <stddef.h>
#include "zstd.h"
Include dependency graph for zstd_ddict.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

const voidZSTD_DDict_dictContent (const ZSTD_DDict *ddict)
 
size_t ZSTD_DDict_dictSize (const ZSTD_DDict *ddict)
 
void ZSTD_copyDDictParameters (ZSTD_DCtx *dctx, const ZSTD_DDict *ddict)
 

Function Documentation

◆ ZSTD_copyDDictParameters()

void ZSTD_copyDDictParameters ( ZSTD_DCtx dctx,
const ZSTD_DDict ddict 
)

Definition at line 58 of file zstd_ddict.c.

59{
60 DEBUGLOG(4, "ZSTD_copyDDictParameters");
61 assert(dctx != NULL);
62 assert(ddict != NULL);
63 dctx->dictID = ddict->dictID;
64 dctx->prefixStart = ddict->dictContent;
65 dctx->virtualStart = ddict->dictContent;
66 dctx->dictEnd = (const BYTE*)ddict->dictContent + ddict->dictSize;
67 dctx->previousDstEnd = dctx->dictEnd;
68#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
69 dctx->dictContentBeginForFuzzing = dctx->prefixStart;
70 dctx->dictContentEndForFuzzing = dctx->previousDstEnd;
71#endif
72 if (ddict->entropyPresent) {
73 dctx->litEntropy = 1;
74 dctx->fseEntropy = 1;
75 dctx->LLTptr = ddict->entropy.LLTable;
76 dctx->MLTptr = ddict->entropy.MLTable;
77 dctx->OFTptr = ddict->entropy.OFTable;
78 dctx->HUFptr = ddict->entropy.hufTable;
79 dctx->entropy.rep[0] = ddict->entropy.rep[0];
80 dctx->entropy.rep[1] = ddict->entropy.rep[1];
81 dctx->entropy.rep[2] = ddict->entropy.rep[2];
82 } else {
83 dctx->litEntropy = 0;
84 dctx->fseEntropy = 0;
85 }
86}
#define NULL
Definition: types.h:112
#define assert(x)
Definition: debug.h:53
#define DEBUGLOG(l,...)
Definition: debug.h:106
if(dx< 0)
Definition: linetemp.h:194
const HUF_DTable * HUFptr
const ZSTD_seqSymbol * MLTptr
const void * virtualStart
const ZSTD_seqSymbol * OFTptr
const void * prefixStart
ZSTD_entropyDTables_t entropy
const void * previousDstEnd
const ZSTD_seqSymbol * LLTptr
ZSTD_entropyDTables_t entropy
Definition: zstd_ddict.c:40
size_t dictSize
Definition: zstd_ddict.c:39
const void * dictContent
Definition: zstd_ddict.c:38
U32 entropyPresent
Definition: zstd_ddict.c:42
ZSTD_seqSymbol LLTable[SEQSYMBOL_TABLE_SIZE(LLFSELog)]
ZSTD_seqSymbol MLTable[SEQSYMBOL_TABLE_SIZE(MLFSELog)]
ZSTD_seqSymbol OFTable[SEQSYMBOL_TABLE_SIZE(OffFSELog)]
HUF_DTable hufTable[HUF_DTABLE_SIZE(HufLog)]
unsigned char BYTE
Definition: xxhash.c:193

Referenced by ZSTD_decompressBegin_usingDDict().

◆ ZSTD_DDict_dictContent()

const void * ZSTD_DDict_dictContent ( const ZSTD_DDict ddict)

Definition at line 46 of file zstd_ddict.c.

47{
48 assert(ddict != NULL);
49 return ddict->dictContent;
50}

Referenced by ZSTD_decompressBegin_usingDDict(), ZSTD_decompressMultiFrame(), and ZSTD_decompressStream().

◆ ZSTD_DDict_dictSize()

size_t ZSTD_DDict_dictSize ( const ZSTD_DDict ddict)

Definition at line 52 of file zstd_ddict.c.

53{
54 assert(ddict != NULL);
55 return ddict->dictSize;
56}

Referenced by ZSTD_decompressBegin_usingDDict(), ZSTD_decompressMultiFrame(), and ZSTD_decompressStream().