10c16b537SWarner Losh /* 2*5ff13fbcSAllan Jude * Copyright (c) Yann Collet, Facebook, Inc. 30c16b537SWarner Losh * All rights reserved. 40c16b537SWarner Losh * 50c16b537SWarner Losh * This source code is licensed under both the BSD-style license (found in the 60c16b537SWarner Losh * LICENSE file in the root directory of this source tree) and the GPLv2 (found 70c16b537SWarner Losh * in the COPYING file in the root directory of this source tree). 80c16b537SWarner Losh * You may select, at your option, one of the above-listed licenses. 90c16b537SWarner Losh */ 100c16b537SWarner Losh 110c16b537SWarner Losh /* This library is designed for a single-threaded console application. 120c16b537SWarner Losh * It exit() and printf() into stderr when it encounters an error condition. */ 130c16b537SWarner Losh 140c16b537SWarner Losh #ifndef DIBIO_H_003 150c16b537SWarner Losh #define DIBIO_H_003 160c16b537SWarner Losh 170c16b537SWarner Losh 180c16b537SWarner Losh /*-************************************* 190c16b537SWarner Losh * Dependencies 200c16b537SWarner Losh ***************************************/ 210c16b537SWarner Losh #define ZDICT_STATIC_LINKING_ONLY 22*5ff13fbcSAllan Jude #include "../lib/zdict.h" /* ZDICT_params_t */ 230c16b537SWarner Losh 240c16b537SWarner Losh 250c16b537SWarner Losh /*-************************************* 260c16b537SWarner Losh * Public functions 270c16b537SWarner Losh ***************************************/ 280c16b537SWarner Losh /*! DiB_trainFromFiles() : 290c16b537SWarner Losh Train a dictionary from a set of files provided by `fileNamesTable`. 300c16b537SWarner Losh Resulting dictionary is written into file `dictFileName`. 310c16b537SWarner Losh `parameters` is optional and can be provided with values set to 0, meaning "default". 320c16b537SWarner Losh @return : 0 == ok. Any other : error. 330c16b537SWarner Losh */ 34*5ff13fbcSAllan Jude int DiB_trainFromFiles(const char* dictFileName, size_t maxDictSize, 35*5ff13fbcSAllan Jude const char** fileNamesTable, int nbFiles, size_t chunkSize, 360c16b537SWarner Losh ZDICT_legacy_params_t* params, ZDICT_cover_params_t* coverParams, 37*5ff13fbcSAllan Jude ZDICT_fastCover_params_t* fastCoverParams, int optimize, unsigned memLimit); 380c16b537SWarner Losh 390c16b537SWarner Losh #endif 40