1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

added a few documentation words about dictionary training

partially answering questions such as #3233
which looks for guidance within `exmaples/`.
This commit is contained in:
Yann Collet
2022-08-05 17:09:22 +02:00
parent 03cc84fddb
commit 3f7a1b1328
2 changed files with 33 additions and 11 deletions

View File

@ -6,7 +6,17 @@
* LICENSE file in the root directory of this source tree) and the GPLv2 (found
* in the COPYING file in the root directory of this source tree).
* You may select, at your option, one of the above-listed licenses.
*/
**/
/* This example deals with Dictionary compression,
* its counterpart is `examples/dictionary_decompression.c` .
* These examples presume that a dictionary already exists.
* The main method to create a dictionary is `zstd --train`,
* look at the CLI documentation for details.
* Another possible method is to employ dictionary training API,
* published in `lib/zdict.h` .
**/
#include <stdio.h> // printf
#include <stdlib.h> // free
#include <string.h> // memset, strcat
@ -14,7 +24,7 @@
#include "common.h" // Helper functions, CHECK(), and CHECK_ZSTD()
/* createDict() :
`dictFileName` is supposed to have been created using `zstd --train` */
** `dictFileName` is supposed already created using `zstd --train` */
static ZSTD_CDict* createCDict_orDie(const char* dictFileName, int cLevel)
{
size_t dictSize;