]> git.proxmox.com Git - ceph.git/blob - ceph/src/zstd/contrib/experimental_dict_builders/randomDictBuilder/random.h
bump version to 15.2.11-pve1
[ceph.git] / ceph / src / zstd / contrib / experimental_dict_builders / randomDictBuilder / random.h
1 #include <stdio.h> /* fprintf */
2 #include <stdlib.h> /* malloc, free, qsort */
3 #include <string.h> /* memset */
4 #include <time.h> /* clock */
5 #include "zstd_internal.h" /* includes zstd.h */
6 #ifndef ZDICT_STATIC_LINKING_ONLY
7 #define ZDICT_STATIC_LINKING_ONLY
8 #endif
9 #include "zdict.h"
10
11
12
13 typedef struct {
14 unsigned k; /* Segment size : constraint: 0 < k : Reasonable range [16, 2048+]; Default to 200 */
15 ZDICT_params_t zParams;
16 } ZDICT_random_params_t;
17
18
19 /*! ZDICT_trainFromBuffer_random():
20 * Train a dictionary from an array of samples.
21 * Samples must be stored concatenated in a single flat buffer `samplesBuffer`,
22 * supplied with an array of sizes `samplesSizes`, providing the size of each sample, in order.
23 * The resulting dictionary will be saved into `dictBuffer`.
24 * @return: size of dictionary stored into `dictBuffer` (<= `dictBufferCapacity`)
25 * or an error code, which can be tested with ZDICT_isError().
26 */
27 ZDICTLIB_API size_t ZDICT_trainFromBuffer_random( void *dictBuffer, size_t dictBufferCapacity,
28 const void *samplesBuffer, const size_t *samplesSizes, unsigned nbSamples,
29 ZDICT_random_params_t parameters);