blob: a96104c36d704d8b00c30997fc3746c4e54a9a80 [file] [log] [blame]
Yann Collet32fb4072017-08-18 16:52:05 -07001/*
Elliott Hughes44aba642023-09-12 20:18:59 +00002 * Copyright (c) Meta Platforms, Inc. and affiliates.
Yann Collet4ded9e52016-08-30 10:04:33 -07003 * All rights reserved.
4 *
Yann Collet32fb4072017-08-18 16:52:05 -07005 * 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 Collet3128e032017-09-08 00:09:23 -07008 * You may select, at your option, one of the above-listed licenses.
Yann Collet4ded9e52016-08-30 10:04:33 -07009 */
Yann Collet71eafdd2016-02-12 02:31:57 +010010
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 Collete69b8cc2016-06-04 18:56:23 +020021#define ZDICT_STATIC_LINKING_ONLY
Nick Terrell09149be2021-04-30 15:02:12 -070022#include "../lib/zdict.h" /* ZDICT_params_t */
Yann Collet71eafdd2016-02-12 02:31:57 +010023
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*/
stanjo7452598d52021-10-04 17:47:52 -070034int DiB_trainFromFiles(const char* dictFileName, size_t maxDictSize,
35 const char** fileNamesTable, int nbFiles, size_t chunkSize,
Yann Collet42a02ab2018-08-15 14:35:38 -070036 ZDICT_legacy_params_t* params, ZDICT_cover_params_t* coverParams,
Elliot Gorokhovsky71c0c072021-12-10 16:19:40 -050037 ZDICT_fastCover_params_t* fastCoverParams, int optimize, unsigned memLimit);
Yann Collet71eafdd2016-02-12 02:31:57 +010038
Yann Collet71eafdd2016-02-12 02:31:57 +010039#endif