aboutsummaryrefslogtreecommitdiff
path: root/src/xz/message.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-01-11xz: Fix warning -Wformat-nonliteral on clang in message.c.Jia Tan1-0/+9
clang and gcc differ in how they handle -Wformat-nonliteral. gcc will allow a non-literal format string as long as the function takes its format arguments as a va_list.
2022-11-28xz: Use lzma_str_from_filters().Lasse Collin1-168/+7
Two uses: Displaying encoder filter chain when compressing with -vv, and displaying the decoder filter chain in --list -vv.
2022-11-14Replace the experimental ARM64 filter with a new experimental version.Lasse Collin1-3/+10
This is incompatible with the previous version. This has space/tab fixes in filter_*.c and bcj.h too.
2022-11-09xz: Add --arm64 to --long-help and omit endianness from ARM(-Thumb).Lasse Collin1-2/+3
Modern 32-bit ARM in big endian mode use little endian for instruction encoding still, so the filters work on such executables too. It's likely less confusing for users this way. The --arm64 option hasn't been implemented yet (there is --experimental-arm64 but it's different). The --arm64 option is added now anyway because this is the likely result and the strings need to be ready for translators. Thanks to Jia Tan.
2022-11-09xz: Add .lz (lzip) decompression support.Lasse Collin1-1/+1
If configured with --disable-lzip-decoder then --long-help will still list `lzip' in --format but I left it like that since due to translations it would be messy to have two help strings. Features are disabled only in special situations so wrong help in such a situation shouldn't matter much. Thanks to Michał Górny for the original patch.
2022-11-09xz: Add a comment why --to-stdout is not in --help.Lasse Collin1-0/+3
It is on the man page still.
2022-11-07xz: Avoid a compiler warning in progress_speed() in message.c.Jia Tan1-6/+3
This should be smaller too since it avoids the string constants.
2022-09-19xz: Add --experimental-arm64[=width=WIDTH].Lasse Collin1-0/+7
It will be renamed to --arm64 once it is stable. Man page or --long-help weren't updated yet.
2022-04-12xz: Add --memlimit-mt-decompress along with a default limit value.Lasse Collin1-1/+3
--memlimit-mt-decompress allows specifying the limit for multithreaded decompression. This matches memlimit_threading in liblzma. This limit can only affect the number of threads being used; it will never prevent xz from decompressing a file. The old --memlimit-decompress option is still used at the same time. If the value of --memlimit-decompress (the default value or one specified by the user) is less than the value of --memlimit-mt-decompress , then --memlimit-mt-decompress is reduced to match --memlimit-decompress. Man page wasn't updated yet.
2019-06-24Add LZMA_RET_INTERNAL1..8 to lzma_ret and use one for LZMA_TIMED_OUT.Lasse Collin1-0/+8
LZMA_TIMED_OUT is *internally* used as a value for lzma_ret enumeration. Previously it was #defined to 32 and cast to lzma_ret. That way it wasn't visible in the public API, but this was hackish. Now the public API has eight LZMA_RET_INTERNALx members and LZMA_TIMED_OUT is #defined to LZMA_RET_INTERNAL1. This way the code is cleaner overall although the public API has a few extra mysterious enum members.
2019-06-23xz: Fix some of the warnings from -Wsign-conversion.Lasse Collin1-2/+2
2018-12-20xz: Fix a crash in progress indicator when in passthru mode.Lasse Collin1-2/+16
"xz -dcfv not_an_xz_file" crashed (all four options are required to trigger it). It caused xz to call lzma_get_progress(&strm, ...) when no coder was initialized in strm. In this situation strm.internal is NULL which leads to a crash in lzma_get_progress(). The bug was introduced when xz started using lzma_get_progress() to get progress info for multi-threaded compression, so the bug is present in versions 5.1.3alpha and higher. Thanks to Filip Palian <Filip.Palian@pjwstk.edu.pl> for the bug report.
2017-04-21liblzma: Rename LZMA_SEEK to LZMA_SEEK_NEEDED and seek_in to seek_pos.Lasse Collin1-1/+1
2017-03-30liblzma: Add generic support for input seeking (LZMA_SEEK).Lasse Collin1-0/+1
Also mention LZMA_SEEK in xz/message.c to silence a warning.
2015-03-07xz: Fix a comment and silence a warning in message.c.Lasse Collin1-2/+3
2014-08-05xz: Add --ignore-check.Lasse Collin1-0/+2
2014-06-29xz: Update the help message of a few options.Lasse Collin1-7/+11
Updated: --threads, --block-size, and --block-list Added: --flush-timeout
2013-07-04xz: Move some of the timing code into mytime.[hc].Lasse Collin1-40/+14
This switches units from microseconds to milliseconds. New clock_gettime(CLOCK_MONOTONIC) will be used if available. There is still a fallback to gettimeofday().
2012-12-14Make the progress indicator smooth in threaded mode.Lasse Collin1-7/+13
This adds lzma_get_progress() to liblzma and takes advantage of it in xz. lzma_get_progress() collects progress information from the thread-specific structures so that fairly accurate progress information is available to applications. Adding a new function seemed to be a better way than making the information directly available in lzma_stream (like total_in and total_out are) because collecting the information requires locking mutexes. It's waste of time to do it more often than the up to date information is actually needed by an application.
2012-12-13xz: Mention --threads in --help.Lasse Collin1-0/+4
Thanks to Olivier Delhomme for pointing out that this was still missing.
2012-08-13xz: Add a warning to --help about alpha and beta versions.Lasse Collin1-0/+5
2012-07-03xz: Add incomplete support for --block-list.Lasse Collin1-0/+6
It's broken with threads and when also --block-size is used.
2012-05-28xz: Don't show a huge number in -vv when memory limit is disabled.Lasse Collin1-1/+11
2012-05-27xz: Fix output of verbose --robot --list modes.Lasse Collin1-1/+1
It printed the filename in "filename (x/y)" format which it obviously shouldn't do in robot mode.
2011-05-21xz: Translate also the string used to print the program name.Lasse Collin1-1/+5
French needs a space before a colon, e.g. "xz : foo error".
2011-05-17Add underscores to attributes (__attribute((__foo__))).Lasse Collin1-1/+1
2011-04-11xz: Move the description of --block-size in --long-help.Lasse Collin1-4/+4
2011-03-18xz: Add --block-size=SIZE.Lasse Collin1-0/+4
This uses LZMA_FULL_FLUSH every SIZE bytes of input. Man page wasn't updated yet.
2011-03-18xz: Add --single-stream.Lasse Collin1-1/+5
This can be useful when there is garbage after the compressed stream (.xz, .lzma, or raw stream). Man page wasn't updated yet.
2010-10-21xz: Make sure that message_strm() can never return NULL.Lasse Collin1-2/+5
2010-10-11xz: Avoid SA_RESTART for portability reasons.Lasse Collin1-23/+15
SA_RESTART is not as portable as I had hoped. It's missing at least from OpenVMS, QNX, and DJGPP). Luckily we can do fine without SA_RESTART.
2010-10-10xz: Use "%"PRIu32 instead of "%d" in a format string.Lasse Collin1-1/+1
2010-09-10xz: Add a comment to translators about "literal context bits".Lasse Collin1-0/+4
2010-09-10xz: Multiple fixes.Lasse Collin1-21/+35
The code assumed that printing numbers with thousand separators and decimal points would always produce only US-ASCII characters. This was used for buffer sizes (with snprintf(), no overflows) and aligning columns of the progress indicator and --list. That assumption was wrong (e.g. LC_ALL=fi_FI.UTF-8 with glibc), so multibyte character support was added in this commit. The old way is used if the operating system doesn't have enough multibyte support (e.g. lacks wcwidth()). The sizes of buffers were increased to accomodate multibyte characters. I don't know how big they should be exactly, but they aren't used for anything critical, so it's not too bad. If they still aren't big enough, I hopefully get a bug report. snprintf() takes care of avoiding buffer overflows. Some static buffers were replaced with buffers allocated on stack. double_to_str() was removed. uint64_to_str() and uint64_to_nicestr() now share the static buffer and test for thousand separator support. Integrity check names "None" and "Unknown-N" (2 <= N <= 15) were marked to be translated. I had forgot these, plus they wouldn't have worked correctly anyway before this commit, because printing tables with multibyte strings didn't work. Thanks to Marek Černocký for reporting the bug about misaligned table columns in --list output.
2010-09-04xz: Minor improvements to --help and --long-help.Lasse Collin1-12/+12
2010-09-03xz: Make --help two lines shorter.Lasse Collin1-2/+5
At least for now, the --help option doesn't list any options that take arguments, so "Mandatory arguments to..." can be omitted.
2010-08-07Disable the memory usage limiter by default.Lasse Collin1-29/+10
For several people, the limiter causes bigger problems that it solves, so it is better to have it disabled by default. Those who want to have a limiter by default need to enable it via the environment variable XZ_DEFAULTS. Support for environment variable XZ_DEFAULTS was added. It is parsed before XZ_OPT and technically identical with it. The intended uses differ quite a bit though; see the man page. The memory usage limit can now be set separately for compression and decompression using --memlimit-compress and --memlimit-decompress. To set both at once, -M or --memlimit can be used. --memory was retained as a legacy alias for --memlimit for backwards compatibility. The semantics of --info-memory were changed in backwards incompatible way. Compatibility wasn't meaningful due to changes in the memory usage limiter functionality. The memory usage limiter info is no longer shown at the bottom of xz --long -help. The memory usage limiter support for removed completely from xzdec. xz's man page was updated to match the above changes. Various unrelated fixes were also made to the man page.
2010-06-15Add --no-adjust.Lasse Collin1-1/+5
2010-06-02Fix compiling with -Werror.Lasse Collin1-2/+2
2010-06-02Adjust SA_RESTART workaround.Lasse Collin1-7/+7
I want to get a bug report if something else than DJGPP lacks SA_RESTART.
2010-06-01Rename message_filters_get() to message_filters_to_str().Lasse Collin1-2/+2
2010-05-27Remove references to the Subblock filter in xz and tests.Lasse Collin1-9/+0
Thanks to Jonathan Nieder.
2010-05-16Split message_filters().Lasse Collin1-67/+120
message_filters_to_str() converts the filter chain to a string. message_filters_show() replaces the original message_filters(). uint32_to_optstr() was also added to show the dictionary size in nicer format when possible.
2010-04-12Show both elapsed time and estimated remaining time in xz -v.Lasse Collin1-48/+38
The extra space for showing both has been taken from the sizes field. If the sizes grow big, bigger units than MiB will be used. It makes it slightly difficult to see that progress is still happening with huge files, but it should be OK in practice. Thanks to Trent W. Buck for <http://bugs.debian.org/574583> and Jonathan Nieder for suggestions how to fix it.
2010-03-07Consistently round up the memory usage limit in messages.Lasse Collin1-2/+3
It still feels a bit wrong to round 1 byte to 1 MiB but at least it is now done consistently so that the same byte value is always rounded the same way to MiB.
2010-02-12Collection of language fixes to comments and docs.Lasse Collin1-5/+5
Thanks to Jonathan Nieder.
2010-01-31Improve displaying of the memory usage limit.Lasse Collin1-8/+29
2010-01-31Delay opening the destionation file and other fixes.Lasse Collin1-20/+26
The opening of the destination file is now delayed a little. The coder is initialized, and if decompressing, the memory usage of the first Block compared against the memory usage limit before the destination file is opened. This means that if --force was used, the old "target" file won't be deleted so easily when something goes wrong very early. Thanks to Mark K for the bug report. The above fix required some changes to progress message handling. Now there is a separate function for setting and printing the filename. It is used also in list.c. list_file() now handles stdin correctly (gives an error). A useless check for user_abort was removed from file_io.c.
2010-01-27Use PACKAGE_URL instead of custom PACKAGE_HOMEPAGE.Lasse Collin1-1/+1
2010-01-24Some improvements to printing sizes in xz.Lasse Collin1-55/+25
2009-12-07Add a note for translators to add a bug reporting addressLasse Collin1-0/+4
for translation bugs.
2009-12-07Prevent xgettext from taking one regular string as a C format string.Lasse Collin1-1/+1
Thanks to Marek Černocký.
2009-11-25Create sparse files by default when decompressing intoLasse Collin1-0/+1
a regular file. Sparse file creation can be disabled with --no-sparse. I don't promise yet that the name of this option won't change before 5.0.0. It's possible that the code, that checks when it is safe to use sparse output on stdout, is not good enough, and a more flexible command line option is needed to configure sparse file handling.
2009-11-16Add support for --info-memory and --robot to xz.Lasse Collin1-12/+35
Currently --robot works only with --info-memory and --version. --help and --long-help work too, but --robot has no effect on them. Thanks to Jonathan Nieder for the original patches.
2009-11-14Fix description of --memory in --long-help.Lasse Collin1-2/+1
2009-10-16Mention --check=none in --long-help. It was already inLasse Collin1-1/+1
the man page though. Thanks to Jim Meyering for noticing this.
2009-09-19Various changes.Lasse Collin1-14/+16
Separate a few reusable components from XZ Utils specific code. The reusable code is now in "tuklib" modules. A few more could be separated still, e.g. bswap.h. Fix some bugs in lzmainfo. Fix physmem and cpucores code on OS/2. Thanks to Elbert Pol for help. Add OpenVMS support into physmem. Add a few #ifdefs to ease building XZ Utils on OpenVMS. Thanks to Jouk Jansen for the original patch.
2009-09-12A few grammar fixes.Lasse Collin1-11/+11
Thanks to Christian Weisgerber for pointing out some of these.
2009-07-02Define PACKAGE_HOMEPAGE in configure.ac and use it inLasse Collin1-2/+2
xz and xzdec. Use also PACKAGE_NAME instead of hardcoding "XZ Utils".
2009-06-26Ugly hack to make it possible to use the thousand separatorLasse Collin1-8/+9
format character with snprintf() on POSIX systems but not on non-POSIX systems and still keep xgettext working.
2009-05-23Add support for specifying the BCJ filter start offsetLasse Collin1-6/+8
in the xz command line tool.
2009-05-22Add --no-warn.Lasse Collin1-0/+4
2009-05-22Make the default memory usage limit 40 % of RAM for bothLasse Collin1-15/+13
compressing and decompressing. This should be OK now that xz automatically scales down the compression settings if they would exceed the memory usage limit (earlier, the limit for compression was increased to 90 % because low limit broke scripts that used "xz -9" on systems with low RAM). Support spcifying the memory usage limit as a percentage of RAM (e.g. --memory=50%). Support --threads=0 to reset the thread limit to the default value (number of available CPU cores). Use UINT32_MAX instead of SIZE_MAX as the maximum in args.c. hardware.c was already expecting uint32_t value. Cleaned up the output of --help and --long-help.
2009-04-13Put the interesting parts of XZ Utils into the public domain.Lasse Collin1-10/+3
Some minor documentation cleanups were made at the same time.
2009-02-22Add a rough explanation of --extreme to output of --help.Lasse Collin1-0/+4
2009-02-22Fixes to progress message handling in xz:Lasse Collin1-177/+306
- Don't use Windows-specific code on Windows. The old code required at least Windows 2000. Now it should work on Windows 98 and later, and maybe on Windows 95 too. - Use less precision when showing estimated remaining time. - Fix some small design issues.
2009-02-14Fix microsecond vs. nanosecond confusion in my_time().Lasse Collin1-1/+1
2009-02-14Cleanups to the code that detects the amount of RAM andLasse Collin1-2/+3
the number of CPU cores. Added support for using sysinfo() on Linux systems whose libc lacks appropriate sysconf() support (at least dietlibc). The Autoconf macros were split into separate files, and CPU core count detection was moved from hardware.c to cpucores.h. The core count isn't used for anything real for now, so a problematic part in process.c was commented out.
2009-02-13Changed how the version number is specified in various places.Lasse Collin1-1/+1
Now configure.ac will get the version number directly from src/liblzma/api/lzma/version.h. The intent is to reduce the number of places where the version number is duplicated. In future, support for displaying Git commit ID may be added too.
2009-02-13Improve support for DOS-like systems.Lasse Collin1-0/+3
Here DOS-like means DOS, Windows, and OS/2.
2009-02-05Various code cleanups the the xz command line tool.Lasse Collin1-8/+57
It now builds with MinGW.
2008-12-27Some xz command line tool improvements.Lasse Collin1-2/+2
2008-12-17xz message handling improvementsLasse Collin1-11/+114
2008-12-10Remove obsolete comment.Lasse Collin1-1/+0
2008-12-10Use "decompression" consistently in --long-help.Lasse Collin1-1/+1
2008-12-10Added preset=NUM to --lzma1 and --lzma2. This makes it easyLasse Collin1-0/+1
to take a preset as a template and modify it a little.
2008-11-28Tested using COLUMNS environment variable to avoid brokenLasse Collin1-5/+9
progress indicator but since COLUMNS isn't usually available, the code was left commented out.
2008-11-27Cleanups to message.c.Lasse Collin1-29/+18
2008-11-19Renamed lzma to xz and lzmadec to xzdec. We create symlinksLasse Collin1-0/+892
lzma, unlzma, and lzcat in "make install" for backwards compatibility with LZMA Utils 4.32.x; I'm not sure if this should be the default though.