11 Commits

Author SHA1 Message Date
Eric Biggers
7ba3155c17 programs: rename program_invocation_name to prog_invocation_name
Avoid confusion with the GNU extension 'program_invocation_name', which
is described by 'man 3 program_invocation_name'.  The GNU version isn't
supposed to be exposed without defining _GNU_SOURCE, which we don't in
any of the relevant files, but it's best to avoid any confusion.
2020-10-25 20:49:27 -07:00
Eric Biggers
4c92394eaa Support level 0, "no compression"
Some users may require a valid DEFLATE, zlib, or gzip stream but know
ahead of time that particular inputs are not compressible.  zlib
supports "level 0" for this use case.  Support this in libdeflate too.

Resolves https://github.com/ebiggers/libdeflate/issues/86
2020-10-10 22:31:15 -07:00
Eric Biggers
740820bd66 programs: define begin_program()
In preparation for testing freestanding library builds, make all
programs call a function begin_program().
2020-04-17 21:28:49 -07:00
Eric Biggers
ce6a95f47b programs: add test_util
Move program utility functions that are used only by "test programs"
(i.e. not by gzip/gunzip) from prog_util.{c,h} into test_util.{c,h}.
This reduces the code that is compiled for the default build target,
which excludes the test programs.
2018-12-28 10:25:44 -06:00
Eric Biggers
1726e9e87f benchmark: make it easier to integrate other compression/decompression engines 2017-05-29 18:37:01 -07:00
Eric Biggers
f100a42c02 gzip, gunzip: require -f or -c to (de)compress symlink
This matches the behavior of GNU gzip.
2016-10-23 13:54:53 -07:00
Eric Biggers
31c4ac39a7 programs: fix signs of some exit statuses 2016-10-16 17:37:32 -07:00
Eric Biggers
e20e275081 prog_util: use QueryPerformanceCounter() on Windows
QueryPerformanceCounter() is much more accurate than
GetSystemTimeAsFileTime().

Also avoid converting into a specific time unit until the results need
to be displayed.  This is more efficient and avoids losing precision.
2016-10-16 14:20:18 -07:00
Eric Biggers
3992efa340 Update API to avoid naming collisions 2016-08-27 23:11:32 -07:00
Eric Biggers
27125469cd v0.2 2016-05-21 15:38:15 -05:00
Eric Biggers
f2c3a5b4e9 Various reorganization and cleanups
* Bring in common headers and program code from xpack project
* Move program code to programs/
* Move library code to lib/
* GNU89 and MSVC2010 compatibility
* Other changes
2016-05-21 15:38:15 -05:00