summaryrefslogtreecommitdiffstats
path: root/lz4c.c
diff options
context:
space:
mode:
authoryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2013-04-26 14:37:46 (GMT)
committeryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2013-04-26 14:37:46 (GMT)
commit40ae7043df0d78f91892d361b5e619b93c3c071d (patch)
tree0f127f7f05ea74b493c1bd034e770f2bdf4c9807 /lz4c.c
parenta2e93db805918a84908373a579c44732d3e6854e (diff)
downloadlz4-40ae7043df0d78f91892d361b5e619b93c3c071d.zip
lz4-40ae7043df0d78f91892d361b5e619b93c3c071d.tar.gz
lz4-40ae7043df0d78f91892d361b5e619b93c3c071d.tar.bz2
- New naming : LZ4_decompress_safe() and LZ4_decompress_fast()
- New function : LZ4_decompress_safe_partial(), to decompress just enough data within a compressed block, saving CPU cycles - New source files : lz4_decoder.h, lz4_encoder.h, lz4hc_encoder.h - Improved speed of LZ4_decompress_fast() - Improved speed for compression of small blocks < 64KB - Improved speed for HC compression git-svn-id: https://lz4.googlecode.com/svn/trunk@94 650e7d94-2a16-8b24-b05c-7c0b3f6821cd
Diffstat (limited to 'lz4c.c')
-rw-r--r--lz4c.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lz4c.c b/lz4c.c
index 85c074a..fe5a9e7 100644
--- a/lz4c.c
+++ b/lz4c.c
@@ -169,8 +169,6 @@ int usage(char* exename)
DISPLAY( " -d : decompression \n");
DISPLAY( " -y : overwrite without prompting \n");
DISPLAY( " -H : Help (this text + advanced options)\n");
- DISPLAY( "input : can be 'stdin' (pipe) or a filename\n");
- DISPLAY( "output : can be 'stdout'(pipe) or a filename or 'null'\n");
return 0;
}
@@ -183,6 +181,9 @@ int usage_advanced()
DISPLAY( " -nx : disable stream checksum (default:enabled)\n");
DISPLAY( " -b# : benchmark files, using # [0-1] compression level\n");
DISPLAY( " -i# : iteration loops [1-9](default : 3), benchmark mode only\n");
+ DISPLAY( "input : can be 'stdin' (pipe) or a filename\n");
+ DISPLAY( "output : can be 'stdout'(pipe) or a filename or 'null'\n");
+ DISPLAY( " example : lz4c -hc stdin compressedfile.lz4");
return 0;
}
@@ -492,7 +493,7 @@ unsigned long long decodeLegacyStream(FILE* finput, FILE* foutput)
uselessRet = fread(in_buff, 1, blockSize, finput);
// Decode Block
- sinkint = LZ4_uncompress_unknownOutputSize(in_buff, out_buff, blockSize, LEGACY_BLOCKSIZE);
+ sinkint = LZ4_decompress_safe(in_buff, out_buff, blockSize, LEGACY_BLOCKSIZE);
if (sinkint < 0) EXM_THROW(52, "Decoding Failed ! Corrupted input detected !");
filesize += sinkint;
@@ -603,7 +604,7 @@ unsigned long long decodeLZ4S(FILE* finput, FILE* foutput)
else
{
// Decode Block
- decodedBytes = LZ4_uncompress_unknownOutputSize(in_buff, out_buff, blockSize, maxBlockSize);
+ decodedBytes = LZ4_decompress_safe(in_buff, out_buff, blockSize, maxBlockSize);
if (decodedBytes < 0) EXM_THROW(77, "Decoding Failed ! Corrupted input detected !");
filesize += decodedBytes;
if (streamChecksumFlag) XXH32_update(streamChecksumState, out_buff, decodedBytes);