static int g_displayLevel = DISPLAY_LEVEL_DEFAULT; /* 0 : no display, 1: errors, 2 : + result + interaction + warnings, 3 : + progression, 4 : + information */
+/*-************************************
+* Check Version (when CLI linked to dynamic library)
+**************************************/
+
+/* Due to usage of experimental symbols and capabilities by the CLI,
+ * the CLI must be linked against a dynamic library of same version */
+static void checkLibVersion(void)
+{
+ if (strcmp(ZSTD_VERSION_STRING, ZSTD_versionString())) {
+ DISPLAYLEVEL(1, "Error : incorrect library version (expecting : %s ; actual : %s ) \n",
+ ZSTD_VERSION_STRING, ZSTD_versionString());
+ DISPLAYLEVEL(1, "Please update library to version %s, or use stand-alone zstd binary \n",
+ ZSTD_VERSION_STRING);
+ exit(1);
+ }
+}
+
+
/*-************************************
* Command Line
**************************************/
/* init */
+ checkLibVersion();
(void)recursive; (void)cLevelLast; /* not used when ZSTD_NOBENCH set */
(void)memLimit;
assert(argCount >= 1);
DISPLAY("error : can't use --patch-from=# on multiple files \n");
CLEAN_RETURN(1);
}
-
- /* No status message in pipe mode (stdin - stdout) */
+
+ /* No status message in pipe mode (stdin - stdout) */
hasStdout = outFileName && !strcmp(outFileName,stdoutmark);
if (hasStdout && (g_displayLevel==2)) g_displayLevel=1;
/* IO Stream/File */
FIO_setHasStdoutOutput(fCtx, hasStdout);
- FIO_setNbFilesTotal(fCtx, (int)filenames->tableSize);
+ FIO_setNbFilesTotal(fCtx, (int)filenames->tableSize);
FIO_determineHasStdinInput(fCtx, filenames);
FIO_setNotificationLevel(g_displayLevel);
FIO_setPatchFromMode(prefs, patchFromDictFileName != NULL);