diff options
| author | Xin LI <delphij@FreeBSD.org> | 2026-04-08 04:01:57 +0000 |
|---|---|---|
| committer | Xin LI <delphij@FreeBSD.org> | 2026-04-08 04:01:57 +0000 |
| commit | 7e509d50854e3f2ba38be3a5e640088c010333af (patch) | |
| tree | 27cdfc7312dd868fce2fcd8687ac61e3fe5bb434 /examples/dictionary_compression.c | |
| parent | b3392d84da5bf2162baf937c77e0557f3fd8a52b (diff) | |
Diffstat (limited to 'examples/dictionary_compression.c')
| -rw-r--r-- | examples/dictionary_compression.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/examples/dictionary_compression.c b/examples/dictionary_compression.c index 0eee6508e748..83edc1cad9b7 100644 --- a/examples/dictionary_compression.c +++ b/examples/dictionary_compression.c @@ -1,12 +1,22 @@ /* - * Copyright (c) Yann Collet, Facebook, Inc. + * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * 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; |
