MCPcopy Create free account
hub / github.com/F-Stack/f-stack / createCDict_orDie

Function createCDict_orDie

freebsd/contrib/zstd/examples/dictionary_compression.c:18–27  ·  view source on GitHub ↗

createDict() : `dictFileName` is supposed to have been created using `zstd --train` */

Source from the content-addressed store, hash-verified

16/* createDict() :
17 `dictFileName` is supposed to have been created using `zstd --train` */
18static ZSTD_CDict* createCDict_orDie(const char* dictFileName, int cLevel)
19{
20 size_t dictSize;
21 printf("loading dictionary %s \n", dictFileName);
22 void* const dictBuffer = mallocAndLoadFile_orDie(dictFileName, &dictSize);
23 ZSTD_CDict* const cdict = ZSTD_createCDict(dictBuffer, dictSize, cLevel);
24 CHECK(cdict != NULL, "ZSTD_createCDict() failed!");
25 free(dictBuffer);
26 return cdict;
27}
28
29
30static void compress(const char* fname, const char* oname, const ZSTD_CDict* cdict)

Callers 1

mainFunction · 0.85

Calls 4

mallocAndLoadFile_orDieFunction · 0.85
printfFunction · 0.50
ZSTD_createCDictFunction · 0.50
freeFunction · 0.50

Tested by

no test coverage detected