minor API update
This commit is contained in:
@@ -247,8 +247,8 @@ int main(int argCount, const char** argv)
|
|||||||
if (filenameIdx==0) return badusage(programName);
|
if (filenameIdx==0) return badusage(programName);
|
||||||
|
|
||||||
/* building ... */
|
/* building ... */
|
||||||
DiB_setDisplayLevel(displayLevel);
|
DiB_setNotificationLevel(displayLevel);
|
||||||
operationResult = DiB_trainFiles(dictFileName, maxDictSize, filenameTable, filenameIdx, selectionLevel);
|
operationResult = DiB_trainDictionary(dictFileName, maxDictSize, selectionLevel, filenameTable, filenameIdx);
|
||||||
|
|
||||||
if (main_pause) waitEnter();
|
if (main_pause) waitEnter();
|
||||||
free((void*)filenameTable);
|
free((void*)filenameTable);
|
||||||
|
|||||||
@@ -98,8 +98,8 @@ static const size_t maxMemory = (sizeof(size_t)==4) ? (2 GB - 64 MB) : (size_t
|
|||||||
***************************************/
|
***************************************/
|
||||||
#define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
|
#define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
|
||||||
#define DISPLAYLEVEL(l, ...) if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); }
|
#define DISPLAYLEVEL(l, ...) if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); }
|
||||||
static unsigned g_displayLevel = 2; /* 0 : no display; 1: errors; 2: default; 4: full information */
|
static unsigned g_displayLevel = 0; /* 0 : no display; 1: errors; 2: default; 4: full information */
|
||||||
void DiB_setDisplayLevel(unsigned l) { g_displayLevel=l; }
|
void DiB_setNotificationLevel(unsigned l) { g_displayLevel=l; }
|
||||||
|
|
||||||
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
|
#define DISPLAYUPDATE(l, ...) if (g_displayLevel>=l) { \
|
||||||
if (DiB_GetMilliSpan(g_time) > refreshRate) \
|
if (DiB_GetMilliSpan(g_time) > refreshRate) \
|
||||||
@@ -833,9 +833,8 @@ static void DiB_saveDict(const char* dictFileName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DiB_trainFiles(const char* dictFileName, unsigned maxDictSize,
|
int DiB_trainDictionary(const char* dictFileName, unsigned maxDictSize, unsigned shiftRatio,
|
||||||
const char** fileNamesTable, unsigned nbFiles,
|
const char** fileNamesTable, unsigned nbFiles)
|
||||||
unsigned shiftRatio)
|
|
||||||
{
|
{
|
||||||
void* srcBuffer;
|
void* srcBuffer;
|
||||||
size_t benchedSize;
|
size_t benchedSize;
|
||||||
|
|||||||
@@ -23,7 +23,10 @@
|
|||||||
- ztsd public forum : https://groups.google.com/forum/#!forum/lz4c
|
- ztsd public forum : https://groups.google.com/forum/#!forum/lz4c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* *************************************
|
/* This library is designed for a single-threaded console application.
|
||||||
|
* It abruptly exits (exit() function) when it encounters an error condition. */
|
||||||
|
|
||||||
|
/*-*************************************
|
||||||
* Version
|
* Version
|
||||||
***************************************/
|
***************************************/
|
||||||
#define DiB_VERSION_MAJOR 0 /* for breaking interface changes */
|
#define DiB_VERSION_MAJOR 0 /* for breaking interface changes */
|
||||||
@@ -33,12 +36,21 @@
|
|||||||
unsigned DiB_versionNumber (void);
|
unsigned DiB_versionNumber (void);
|
||||||
|
|
||||||
|
|
||||||
/* *************************************
|
/*-*************************************
|
||||||
* Main functions
|
* Main functions
|
||||||
***************************************/
|
***************************************/
|
||||||
int DiB_trainFiles(const char* dictFileName, unsigned maxDictSize,
|
/*! DiB_trainDictionary
|
||||||
const char** fileNamesTable, unsigned nbFiles,
|
Train a dictionary from a set of files provided by @fileNamesTable
|
||||||
unsigned selectionLevel);
|
Resulting dictionary is written in file @dictFileName
|
||||||
|
@result : 0 if fine
|
||||||
|
*/
|
||||||
|
int DiB_trainDictionary(const char* dictFileName, unsigned maxDictSize, unsigned selectivityLevel,
|
||||||
|
const char** fileNamesTable, unsigned nbFiles);
|
||||||
|
|
||||||
|
|
||||||
void DiB_setDisplayLevel(unsigned l);
|
/*! DiB_setNotificationLevel
|
||||||
|
Set amount of notification to be displayed on the console.
|
||||||
|
0 = no console notification (default).
|
||||||
|
Note : not thread-safe (use a global constant)
|
||||||
|
*/
|
||||||
|
void DiB_setNotificationLevel(unsigned l);
|
||||||
|
|||||||
Reference in New Issue
Block a user