xz utils source code
XZ Utils consist of several components: liblzma is a compression library with an API similar to that of zlib. xz is a command line tool with syntax similar to that of gzip. xzdec is a decompression-only tool smaller than the full-featured xz tool. A set of shell scripts (xzgrep, xzdiff, etc.) have been adapted from gzip to ease viewing, grepping, and comparing compressed files. Emulation of command line tools of LZMA Utils eases transition from LZMA Utils to XZ Utils. While liblzma has a zlib-like API, liblzma doesn't include any file I/O functions. A separate I/O library is planned, which would abstract handling of .gz, .bz2, and .xz files with an easy to use API. https://tukaani.org/xz/