1 #include <stdio.h> /* fprintf */
2 #include <stdlib.h> /* malloc, free, qsort */
3 #include <string.h> /* strcmp, strlen */
4 #include <errno.h> /* errno */
6 #include "zstd_internal.h" /* includes zstd.h */
7 #include "fileio.h" /* stdinmark, stdoutmark, ZSTD_EXTENSION */
8 #include "platform.h" /* Large Files support */
13 /*-*************************************
15 ***************************************/
18 unsigned oneSampleTooLarge;
23 const void* srcBuffer;
24 const size_t *samplesSizes;
31 * Load from input files and add samples to buffer
32 * @return: a sampleInfo struct containing infomation about buffer where samples are stored,
33 * size of each sample, and total number of samples
35 sampleInfo* getSampleInfo(const char** fileNamesTable, unsigned nbFiles, size_t chunkSize,
36 unsigned maxDictSize, const unsigned displayLevel);
41 * Free memory allocated for info
43 void freeSampleInfo(sampleInfo *info);
48 * Save data stored on buff to dictFileName
50 void saveDict(const char* dictFileName, const void* buff, size_t buffSize);
53 unsigned readU32FromChar(const char** stringPtr);
55 /** longCommandWArg() :
56 * check if *stringPtr is the same as longCommand.
57 * If yes, @return 1 and advances *stringPtr to the position which immediately follows longCommand.
58 * @return 0 and doesn't modify *stringPtr otherwise.
60 unsigned longCommandWArg(const char** stringPtr, const char* longCommand);