aboutsummaryrefslogtreecommitdiff
path: root/src/xz/util.h (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2022-10-25xz: Refactor to remove is_empty_filename().Lasse Collin1-4/+0
Long ago it was used in list.c too but nowadays it's needed only in io_open_src() so it's nicer to avoid a separate function.
2011-05-17Add underscores to attributes (__attribute((__foo__))).Lasse Collin1-3/+3
2011-01-18Add alloc_size and malloc attributes to a few functions.Lasse Collin1-2/+3
Thanks to Cristian Rodríguez for the original patch.
2010-09-10xz: Multiple fixes.Lasse Collin1-7/+0
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-01-31Improve displaying of the memory usage limit.Lasse Collin1-0/+6
2010-01-24Some improvements to printing sizes in xz.Lasse Collin1-0/+44
2009-06-26Ugly hack to make it possible to use the thousand separatorLasse Collin1-0/+20
format character with snprintf() on POSIX systems but not on non-POSIX systems and still keep xgettext working.
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-05Various code cleanups the the xz command line tool.Lasse Collin1-5/+0
It now builds with MinGW.
2008-11-19Renamed lzma to xz and lzmadec to xzdec. We create symlinksLasse Collin1-0/+0
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.
2008-11-19Oh well, big messy commit again. Some highlights:Lasse Collin1-2/+41
- Updated to the latest, probably final file format version. - Command line tool reworked to not use threads anymore. Threading will probably go into liblzma anyway. - Memory usage limit is now about 30 % for uncompression and about 90 % for compression. - Progress indicator with --verbose - Simplified --help and full --long-help - Upgraded to the last LGPLv2.1+ getopt_long from gnulib. - Some bug fixes