aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-12-01 01:25:18 +0100
committerMohamad Ayyash <mkayyash@google.com>2015-02-23 17:26:21 -0800
commit88388eeaa9daeafc2451cc1444dd1f1a83193075 (patch)
tree074607747503dd878d3b2831b0a10bb16857b8ec
parentc8b5907b5210774de11e7945994ff7d4a4f31b99 (diff)
downloadlz4-88388eeaa9daeafc2451cc1444dd1f1a83193075.tar.gz
lz4cli : legacy arguments are now disabled by default
-rw-r--r--programs/Makefile6
-rw-r--r--programs/lz4cli.c18
2 files changed, 12 insertions, 12 deletions
diff --git a/programs/Makefile b/programs/Makefile
index 96de0e3a..eca920bc 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -66,13 +66,13 @@ default: lz4 lz4c
all: lz4 lz4c lz4c32 fullbench fullbench32 fuzzer fuzzer32 frametest frametest32 datagen
lz4: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c
- $(CC) $(FLAGS) -DDISABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT)
+ $(CC) $(FLAGS) $^ -o $@$(EXT)
lz4c : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c
- $(CC) $(FLAGS) $^ -o $@$(EXT)
+ $(CC) $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT)
lz4c32: $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c bench.c lz4io.c lz4cli.c
- $(CC) -m32 $(FLAGS) $^ -o $@$(EXT)
+ $(CC) -m32 $(FLAGS) -DENABLE_LZ4C_LEGACY_OPTIONS $^ -o $@$(EXT)
fullbench : $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/xxhash.c fullbench.c
$(CC) $(FLAGS) $^ -o $@$(EXT)
diff --git a/programs/lz4cli.c b/programs/lz4cli.c
index e69a84a8..351de80f 100644
--- a/programs/lz4cli.c
+++ b/programs/lz4cli.c
@@ -32,10 +32,10 @@
//**************************************
// Tuning parameters
//**************************************
-// DISABLE_LZ4C_LEGACY_OPTIONS :
+// ENABLE_LZ4C_LEGACY_OPTIONS :
// Control the availability of -c0, -c1 and -hc legacy arguments
-// Default : Legacy options are enabled
-// #define DISABLE_LZ4C_LEGACY_OPTIONS
+// Default : Legacy options are disabled
+// #define ENABLE_LZ4C_LEGACY_OPTIONS
//**************************************
@@ -201,14 +201,14 @@ int usage_advanced(void)
DISPLAY( "Benchmark arguments :\n");
DISPLAY( " -b : benchmark file(s)\n");
DISPLAY( " -i# : iteration loops [1-9](default : 3), benchmark mode only\n");
-#if !defined(DISABLE_LZ4C_LEGACY_OPTIONS)
+#if defined(ENABLE_LZ4C_LEGACY_OPTIONS)
DISPLAY( "Legacy arguments :\n");
DISPLAY( " -c0 : fast compression\n");
DISPLAY( " -c1 : high compression\n");
DISPLAY( " -hc : high compression\n");
DISPLAY( " -y : overwrite output without prompting \n");
DISPLAY( " -s : suppress warnings \n");
-#endif // DISABLE_LZ4C_LEGACY_OPTIONS
+#endif // ENABLE_LZ4C_LEGACY_OPTIONS
EXTENDED_HELP;
return 0;
}
@@ -250,7 +250,7 @@ int usage_longhelp(void)
DISPLAY( "%s can be used in 'pure pipe mode', for example :\n", programName);
DISPLAY( "3 : compress data stream from 'generator', send result to 'consumer'\n");
DISPLAY( " generator | %s | consumer \n", programName);
-#if !defined(DISABLE_LZ4C_LEGACY_OPTIONS)
+#if defined(ENABLE_LZ4C_LEGACY_OPTIONS)
DISPLAY( "\n");
DISPLAY( "Warning :\n");
DISPLAY( "Legacy arguments take precedence. Therefore : \n");
@@ -259,7 +259,7 @@ int usage_longhelp(void)
DISPLAY( "It is not equivalent to :\n");
DISPLAY( " %s -h -c filename\n", programName);
DISPLAY( "which would display help text and exit\n");
-#endif // DISABLE_LZ4C_LEGACY_OPTIONS
+#endif // ENABLE_LZ4C_LEGACY_OPTIONS
return 0;
}
@@ -325,14 +325,14 @@ int main(int argc, char** argv)
{
argument ++;
-#if !defined(DISABLE_LZ4C_LEGACY_OPTIONS)
+#if defined(ENABLE_LZ4C_LEGACY_OPTIONS)
// Legacy options (-c0, -c1, -hc, -y, -s)
if ((argument[0]=='c') && (argument[1]=='0')) { cLevel=0; argument++; continue; } // -c0 (fast compression)
if ((argument[0]=='c') && (argument[1]=='1')) { cLevel=9; argument++; continue; } // -c1 (high compression)
if ((argument[0]=='h') && (argument[1]=='c')) { cLevel=9; argument++; continue; } // -hc (high compression)
if (*argument=='y') { LZ4IO_setOverwrite(1); continue; } // -y (answer 'yes' to overwrite permission)
if (*argument=='s') { displayLevel=1; continue; } // -s (silent mode)
-#endif // DISABLE_LZ4C_LEGACY_OPTIONS
+#endif // ENABLE_LZ4C_LEGACY_OPTIONS
if ((*argument>='0') && (*argument<='9'))
{