Commit Graph

177 Commits

Author SHA1 Message Date
Yann Collet
22729ecb8b minor refactor
mostly on the compression code path
2020-11-13 11:55:33 -08:00
Yann Collet
b7c6fc9f61 minor refactor of lz4io
for readability.
Mostly around --list capability
2020-11-13 10:57:40 -08:00
Yann Collet
392809d66e fix minor static analyzer warnings
detected by scan-build and cppcheck
fix #786
2020-09-29 17:09:58 -07:00
Niklas Hambüchen
9a7658070a Use fstat() to determine file size.
This allows us to get the file size even when the input file is passed
via stdin. This fixes `--content-size` not working in situations like

    $ lz4 -v --content-size < /tmp/test > /tmp/test.lz4
    Warning : cannot determine input content size

With this change, it works.

Also helps with #904.
2020-08-24 06:27:28 +02:00
Filipe Calasans
781417a369 Implement -m option with legacy format on cli 2020-02-07 17:03:13 -08:00
Filipe Calasans
ac4940cd98 Fix lz4cli --list option 2020-02-06 21:39:54 -08:00
Yann Collet
bb5c34a875 bumped version number to v1.9.2
to reduce risks that future bug reports in `dev` branch report `v1.9.1` as the failing version.
2019-07-01 09:01:43 -07:00
gstedman
81081f9b2d List mode improvements.
Improve formatting
  Include static assert
  Use UTIL_fseek to handle potential fseek limitation
  Be explicit when refusing to read from stdin
  Properly free dctx after use
  Include valgrind tests
2019-05-16 20:53:29 +01:00
gstedman
98a86c8ef6 Add multiframe report to --list command 2019-05-15 21:13:19 +01:00
Yann Collet
35b83a921f fix: no leak when LZ4F_dctx creation fails
strange, because it previous implementation, it would `exit()`,
so it should not matter ...
2019-04-22 16:06:22 -07:00
Yann Collet
5a50247d5f updated code comments 2019-04-22 15:24:44 -07:00
Yann Collet
a685d5cffc --list gives block type 2019-04-22 15:14:53 -07:00
Yann Collet
f401f1de7e --list can resume after a failed file 2019-04-22 15:01:20 -07:00
Yann Collet
0d4c885abb refactored --list function
better handling of special conditions,
better scoping of variables.

Also : updated man page
2019-04-22 14:01:19 -07:00
Yann Collet
ae5cea9112 fixed C90 compliance
re-structure code, have everything into a single section of lz4io.c
2019-04-22 12:27:25 -07:00
gabrielstedman
84f978a2f3 FR #598 - Correctly initialize cfinfo & cast malloc res to (char*) 2019-04-22 11:07:08 +01:00
gabrielstedman
e31b6dc03c FR #598 - Make fileSize unsigned long long 2019-04-22 10:35:29 +01:00
gabrielstedman
0acebbe53d FR #598 - Move LZ4F_compFileInfo_t def to lz4frame.h discard output_file
assert if in om_list mode
2019-04-22 10:02:46 +01:00
gabrielstedman
2133366da0 FR #598 - Make LZ4IO_getCompressedFileInfo internal and reword func 2019-04-22 09:00:20 +01:00
gabrielstedman
5fdc6d201e FR #598 Improve initial design, test mallocs, support C90. 2019-04-21 18:20:40 +01:00
gabrielstedman
55ab3c48ae Add --list option to display compressed file information. 2019-04-21 00:01:03 +01:00
Yann Collet
9c49e3ca07 added tests for -d -m -c
seems to work properly
2019-04-12 16:10:55 -07:00
Yann Collet
e865a3e7ec fixed lz4 -m -c
can compress multiple files into stdout
2019-04-12 15:17:48 -07:00
Tim Zakian
c1610690b1 Add cast around malloc 2019-01-11 09:49:26 -08:00
Tim Zakian
416916146f Add constant pointer annotations 2019-01-10 20:40:00 -08:00
Tim Zakian
5822e667cc Remove a bunch of global variables that tracked settings for the IO module, and move them in to a struct 2019-01-10 15:27:47 -08:00
Tim Zakian
9028682e7a Fix pass-through mode 2019-01-10 10:20:17 -08:00
Blaise Sanouillet
32501603c7 support custom block sizes: fix usage message & remove unused functions 2018-09-28 09:53:14 -07:00
Blaise Sanouillet
718d16ef29 support custom block sizes - fix types 2018-09-28 09:02:36 -07:00
Blaise Sanouillet
64ad395d27 support custom block sizes 2018-09-28 08:02:49 -07:00
Yann Collet
b2215f2a89 tried to clean another bunch of cppcheck warnings
so "funny" thing with cppcheck
is that no 2 versions give the same list of warnings.

On Mac, I'm using v1.81, which had all warnings fixed.
On Travis CI, it's v1.61, and it complains about a dozen more/different things.
On Linux, it's v1.72, and it finds a completely different list of a half dozen warnings.

Some of these seems to be bugs/limitations in cppcheck itself.
The TravisCI version v1.61 seems unable to understand %zu correctly, and seems to assume it means %u.
2018-09-19 12:12:49 -07:00
Yann Collet
b61991491a fixed compression time
displayed at the end (#555)
2018-09-05 15:16:03 -07:00
Yann Collet
5c7d3812d9 fasterDecSpeed can be triggered from cli with --favor-decSpeed 2018-04-26 15:49:32 -07:00
W. Felix Handte
2dfc7cbe82 Change Over Includes in the Project 2018-04-24 16:22:28 -04:00
Yann Collet
133a50b780 fixed DISPLAYUPDATE()
wrong comparison, which was always overflowing (hence was always true)
except when it was not (i386, reported by pmc)
in which case it would never show any information.
2018-04-06 14:16:23 -07:00
W. Felix Handte
9dcd9abc14 Make LZ4F_compressFrame_usingCDict Take a Compression Context 2018-03-12 14:58:43 -04:00
hobomind
b202c67234
fix: missed semicolon at programs/lz4io.c:954 2018-02-14 18:47:56 +03:00
Yann Collet
75e22d133e minor : try to tell static analyzer that we don't care if fseek() fails
as already explained in comments.
2018-01-13 22:52:17 -08:00
Yann Collet
fe66e78b96 lz4io: fixed minor ressource leak 2018-01-13 22:18:04 -08:00
Nick Terrell
9474b706a5 [lz4io] Fix decompression file stat with --rm 2018-01-05 11:27:24 -08:00
Alice Atlas
42a31aee50 Fix bug which could sometimes result in the lz4 cli chmodding /dev/null if running as root 2017-12-04 16:07:31 -05:00
W. Felix Handte
9a16272261 Read the Dictionary into a Circular Buffer 2017-10-09 20:18:21 -04:00
W. Felix Handte
2bd85f4199 Add Dictionary Support to the Command Line Tool 2017-10-09 20:16:00 -04:00
Yann Collet
930a692110 cli : restored command -BX to enable block checksum (#322) 2017-08-11 17:58:46 -07:00
Yann Collet
d18084c655 report where decompression ends (#313)
suggested by @ehem
note : only works for files < 2 GB
2017-06-12 15:47:43 -07:00
Yann Collet
cd35f0d98c LZ4_compress_HC_destSize() uses LZ4HC_compress_generic() code path
Limits compression level to 10,
to remain compatible with Hash Chain.
2017-03-16 15:10:38 -07:00
Yann Collet
9144520dc9 fixed Visual compilation error
static const must be a "constant", like a macro
even if it can be determined at compile time ...
2017-03-15 18:59:26 -07:00
Yann Collet
a33bf89c62 fix #332 : do not modify /dev/null permissions 2017-03-15 17:26:50 -07:00
Przemyslaw Skibinski
68a358769e Avoid fseek()'s 2GiB barrier with MinGW 2017-02-15 17:17:57 +01:00
Przemyslaw Skibinski
fea95c1567 use FindFirstFileA and FindNextFileA on Windows 2016-12-22 10:58:58 +01:00