Commit graph

98 commits

Author SHA1 Message Date
Con Kolivas 3345a239b7 Use lz4 for compressibility testing only, which won't break existing archives, but speeds up testing slightly. This makes liblz4 a required library. 2021-02-16 09:41:14 +11:00
Con Kolivas be884d09e0 Deallocate runzip structures after all runzip chunks are complete to avoid a race in the case of a failed chunk decompressing. 2021-02-15 15:20:12 +11:00
Con Kolivas 2c7c4832b3 Move thread pthread_t to control structure for later access. 2021-02-14 20:37:03 +11:00
Con Kolivas a71f7bdb57 Make ucthreads part of the stream_info struct. 2021-02-14 20:19:47 +11:00
Con Kolivas 96c7c62584 Create a linked list to safely release data which cannot be released earlier after all compression is complete and all compressionthreads have returned, fixing a minor leak. 2021-02-09 18:05:49 +11:00
Con Kolivas 93d579a1b8 Fix misuse of static variable in a header. 2019-12-03 11:23:58 +11:00
Daniel Jewell a8f0dc3a31 Fix Android Detection in lrzip_private.h
lrzip_private.h was checking for "ANDROID" but
it should be __ANDROID__

lrzip now compiles just fine on android, it seems
2019-05-27 20:34:50 -07:00
Con Kolivas d212cc1115 Use dealloc() wrapper to minimise risk of local use after free. 2018-05-16 14:12:22 +10:00
Ingo Brückl 6b50431410 Enable specifying the passphrase as an argument to option 'encrypt'
For various use cases it is desirable to be able to specify the
passphrase for a password protected encryption on the command line.

So allow option 'encrypt' to have an optional argument and set
control->passphrase to this argument if it is given.

Read the passphrase (and prompt for it) only from standard input
if not given on the command line.

Additionally, update documentation.

This fixes github issue #72, reported by aivanise.
2018-03-09 15:48:33 +11:00
Tim Savannah 6e0016daf7 Make liblrzip work when FILE provided is anything other than stdin. This will allow bindings to be created to lrzip 2017-06-04 01:28:18 -04:00
Con Kolivas 56a84987dd Update copyright dates 2016-06-09 11:16:41 +10:00
Con Kolivas b8c1e9ca63 Big endian fix for Solaris Sparc courtesy of joelfredrikson. 2016-06-09 09:49:43 +10:00
Con Kolivas d5a339335b Fix incompatible log callback in liblrzip 2015-03-10 20:27:38 +11:00
Con Kolivas 5c5a8c6cc5 Use int64_t for i64 2015-03-10 20:05:51 +11:00
Con Kolivas 79cebb663b fflush messages on print_err 2015-03-10 13:01:16 +11:00
Con Kolivas 6e31fc621e Cache the chunk bytes value to avoid setting it on each read_header call 2015-03-09 11:46:24 +11:00
ckolivas f690750340 Fix remaining use of mutexes lock/unlocking in different threads with cksems, corecting cksem usage on osx 2015-03-08 10:10:38 +11:00
ckolivas dd9dc7555d Update copyright dates 2015-03-08 08:53:47 +11:00
ckolivas f378595dce Make match_len a function completely removing all indirect calls to get_sb, significantly speeding up the single_get_sb case 2015-03-08 01:21:53 +11:00
ckolivas cb7b0dd339 Make full_tag a pointer allowing us to avoid a function call for get_sb 2015-03-08 00:59:05 +11:00
ckolivas 70db73b955 Make next_tag a pointer to allow ordinary mapping to avoid an extra function call 2015-03-08 00:50:10 +11:00
Con Kolivas d8df50c9b7 Update various copyright dates. 2013-09-02 12:21:54 +10:00
Con Kolivas b076dbb59d Set the control lzma properties only once. 2013-09-01 12:17:51 +10:00
Con Kolivas 4db4641dae Add a control lock mutex for protecting certain control variables. 2013-09-01 12:11:51 +10:00
Con Kolivas 73e921b862 Check endianness of build with autotools to enable md5 support on more platforms. 2012-12-30 13:10:47 +11:00
Con Kolivas 7e88495988 Cope with missing ffsll() on various platforms. 2012-07-07 21:54:05 +10:00
Con Kolivas 901e507bd8 Include test for pthread.h and include header in lrzip_private.h. 2012-07-07 21:16:11 +10:00
Con Kolivas 5edf8471d1 Perform all checksumming in a separate thread to speed up the hash search in the rzip phase. 2012-03-11 11:51:36 +11:00
Con Kolivas 0e593f7681 Pass one less variable to the get_sb function as an optimisation. 2012-03-11 01:04:44 +11:00
Con Kolivas 43402d1c76 Revert "Bypass most checks performed via the inbuilt expect macros likely and unlikely for non-debug builds."
This reverts commit 3a1d097830.

Did not offer any substantial speedup.
2012-03-07 21:57:07 +11:00
ckolivas 3a1d097830 Bypass most checks performed via the inbuilt expect macros likely and unlikely for non-debug builds. 2012-03-07 17:54:04 +11:00
ckolivas af0976f804 Work around rest arguments warnings. 2012-03-07 16:01:13 +11:00
ckolivas 43f407aa04 Remove global variables sliding_buffer get_sb and do_mcpy and put them in rzip_control. 2012-03-07 14:48:21 +11:00
ckolivas e6ae7c528a Add __maybe_unused macro and use to stop warnings from lzma dummy allocs. 2012-03-07 12:58:58 +11:00
ckolivas a62e78186e Merge branch 'liblrzip' of github.com:ckolivas/lrzip into liblrzip
Conflicts:
	rzip.c
2012-03-07 11:41:35 +11:00
Con Kolivas a28def8d05 Mremap is linux only, so reverse the check for its presence and use fake mremap everywhere else. 2011-09-21 16:38:52 +10:00
Con Kolivas a0fe1a8c8e Merge branch 'master' into liblrzip
Conflicts:
	runzip.c
	stream.h
2011-09-15 08:31:00 +10:00
Con Kolivas e1f2138060 Make sure to read to the end of all streams when closing down an rzip stream.
This would have made lrzip unable to decompress some rare archives if they ended up stream 0.
2011-09-15 08:28:30 +10:00
discomfitor 223a1107ea add info callback which provides percentage completion of operation 2011-08-17 20:59:41 +10:00
discomfitor 63141a1035 add some gross bucketing to implement a queue for freeing stream_info structs after an operation has completed (in library mode ONLY; no changes will occur during regular execution) to fix some leaks 2011-08-17 20:59:41 +10:00
discomfitor 949c6d7a97 another semi-clusterfuck commit: *new logging macros *allow compression to and from any FILE, not just stdin/stdout *update main.c to work with the above 2011-08-17 20:59:41 +10:00
discomfitor 6dd20d735b giant clusterfuck commit: *add and use alloca/strdupa in some spots *implement return values on almost every function *free() is now a macro which also nulls the freed pointer *when in 'library mode', fatal_exit() will not be called *fatal()/failure() are now macros which add line number and file for logging *all occurrences of fatal/failure in files other than main.c are now wrapped to use a logging callback (if specified) and then return *functions now clean up resources on returning with an error 2011-08-17 20:59:40 +10:00
discomfitor 133b201867 move more code out of main.c, allocate outfile suffix 2011-08-17 20:59:40 +10:00
discomfitor 08d2294e5e add password callback hook 2011-08-17 20:59:40 +10:00
discomfitor cbff8faef7 move liblrzip.h contents to lrzip_private.h global variables----- 2011-08-17 20:59:40 +10:00
discomfitor 1c64dcfb31 more initialization stuff out of main(), remove weird coincidentally successful one_g variable 2011-08-17 20:59:40 +10:00
discomfitor 59f10b2c9c move functions+defines out of main.c 2011-08-17 20:59:40 +10:00
ckolivas 127a101b14 Disable md5 checking on apple for now till someone fixes it. 2011-04-13 14:50:26 +10:00
Con Kolivas f81f8c68c7 Fixes to make lrzip compile on cygwin courtesy of Тулебаев Салават . 2011-04-11 21:51:53 +10:00
Con Kolivas e561a9a080 mremap is not a macro, check explicitly for freebsd and apple and define it only then. 2011-03-23 08:34:09 +11:00