Yann Collet | 32fb407 | 2017-08-18 16:52:05 -0700 | [diff] [blame] | 1 | /* |
Elliott Hughes | 44aba64 | 2023-09-12 20:18:59 +0000 | [diff] [blame] | 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
Yann Collet | 4ded9e5 | 2016-08-30 10:04:33 -0700 | [diff] [blame] | 3 | * All rights reserved. |
| 4 | * |
Yann Collet | 32fb407 | 2017-08-18 16:52:05 -0700 | [diff] [blame] | 5 | * This source code is licensed under both the BSD-style license (found in the |
| 6 | * LICENSE file in the root directory of this source tree) and the GPLv2 (found |
| 7 | * in the COPYING file in the root directory of this source tree). |
Yann Collet | 3128e03 | 2017-09-08 00:09:23 -0700 | [diff] [blame] | 8 | * You may select, at your option, one of the above-listed licenses. |
Yann Collet | 4ded9e5 | 2016-08-30 10:04:33 -0700 | [diff] [blame] | 9 | */ |
Yann Collet | 71eafdd | 2016-02-12 02:31:57 +0100 | [diff] [blame] | 10 | |
| 11 | /* This library is designed for a single-threaded console application. |
| 12 | * It exit() and printf() into stderr when it encounters an error condition. */ |
| 13 | |
| 14 | #ifndef DIBIO_H_003 |
| 15 | #define DIBIO_H_003 |
| 16 | |
| 17 | |
| 18 | /*-************************************* |
| 19 | * Dependencies |
| 20 | ***************************************/ |
Yann Collet | e69b8cc | 2016-06-04 18:56:23 +0200 | [diff] [blame] | 21 | #define ZDICT_STATIC_LINKING_ONLY |
Nick Terrell | 09149be | 2021-04-30 15:02:12 -0700 | [diff] [blame] | 22 | #include "../lib/zdict.h" /* ZDICT_params_t */ |
Yann Collet | 71eafdd | 2016-02-12 02:31:57 +0100 | [diff] [blame] | 23 | |
| 24 | |
| 25 | /*-************************************* |
| 26 | * Public functions |
| 27 | ***************************************/ |
| 28 | /*! DiB_trainFromFiles() : |
| 29 | Train a dictionary from a set of files provided by `fileNamesTable`. |
| 30 | Resulting dictionary is written into file `dictFileName`. |
| 31 | `parameters` is optional and can be provided with values set to 0, meaning "default". |
| 32 | @return : 0 == ok. Any other : error. |
| 33 | */ |
stanjo74 | 52598d5 | 2021-10-04 17:47:52 -0700 | [diff] [blame] | 34 | int DiB_trainFromFiles(const char* dictFileName, size_t maxDictSize, |
| 35 | const char** fileNamesTable, int nbFiles, size_t chunkSize, |
Yann Collet | 42a02ab | 2018-08-15 14:35:38 -0700 | [diff] [blame] | 36 | ZDICT_legacy_params_t* params, ZDICT_cover_params_t* coverParams, |
Elliot Gorokhovsky | 71c0c07 | 2021-12-10 16:19:40 -0500 | [diff] [blame] | 37 | ZDICT_fastCover_params_t* fastCoverParams, int optimize, unsigned memLimit); |
Yann Collet | 71eafdd | 2016-02-12 02:31:57 +0100 | [diff] [blame] | 38 | |
Yann Collet | 71eafdd | 2016-02-12 02:31:57 +0100 | [diff] [blame] | 39 | #endif |