summaryrefslogtreecommitdiff
path: root/Build/source/extra/xz/src
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-06-13 22:25:43 +0000
committerKarl Berry <karl@freefriends.org>2010-06-13 22:25:43 +0000
commit6019a96432ef8427e402459751109c8b14ec0454 (patch)
tree974dd1260a5003100daa5bb88f279fd477042c93 /Build/source/extra/xz/src
parentf06e0d7e9489163b444e1381a9e670ed1789725d (diff)
xz-4.999.9beta-143-g3e49
git-svn-id: svn://tug.org/texlive/trunk@18955 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/extra/xz/src')
-rw-r--r--Build/source/extra/xz/src/Makefile.in1
-rw-r--r--Build/source/extra/xz/src/common/sysdefs.h16
-rw-r--r--Build/source/extra/xz/src/liblzma/Makefile.am5
-rw-r--r--Build/source/extra/xz/src/liblzma/Makefile.in118
-rw-r--r--Build/source/extra/xz/src/liblzma/api/Makefile.am1
-rw-r--r--Build/source/extra/xz/src/liblzma/api/Makefile.in2
-rw-r--r--Build/source/extra/xz/src/liblzma/api/lzma.h1
-rw-r--r--Build/source/extra/xz/src/liblzma/api/lzma/index.h2
-rw-r--r--Build/source/extra/xz/src/liblzma/common/block_buffer_encoder.c2
-rw-r--r--Build/source/extra/xz/src/liblzma/common/block_util.c6
-rw-r--r--Build/source/extra/xz/src/liblzma/common/common.c2
-rw-r--r--Build/source/extra/xz/src/liblzma/common/common.h6
-rw-r--r--Build/source/extra/xz/src/liblzma/common/filter_common.c9
-rw-r--r--Build/source/extra/xz/src/liblzma/common/filter_decoder.c16
-rw-r--r--Build/source/extra/xz/src/liblzma/common/filter_encoder.c12
-rw-r--r--Build/source/extra/xz/src/liblzma/common/stream_buffer_encoder.c2
-rw-r--r--Build/source/extra/xz/src/liblzma/delta/delta_encoder.c2
-rw-r--r--Build/source/extra/xz/src/liblzma/lz/lz_decoder.c7
-rw-r--r--Build/source/extra/xz/src/liblzma/lz/lz_decoder.h2
-rw-r--r--Build/source/extra/xz/src/liblzma/lz/lz_encoder.c8
-rw-r--r--Build/source/extra/xz/src/liblzma/lz/lz_encoder.h2
-rw-r--r--Build/source/extra/xz/src/liblzma/lz/lz_encoder_mf.c4
-rw-r--r--Build/source/extra/xz/src/liblzma/lzma/lzma2_encoder.c2
-rw-r--r--Build/source/extra/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c2
-rw-r--r--Build/source/extra/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c14
-rw-r--r--Build/source/extra/xz/src/lzmainfo/Makefile.in1
-rw-r--r--Build/source/extra/xz/src/scripts/Makefile.in1
-rw-r--r--Build/source/extra/xz/src/xz/Makefile.in1
-rw-r--r--Build/source/extra/xz/src/xz/args.c12
-rw-r--r--Build/source/extra/xz/src/xz/list.c654
-rw-r--r--Build/source/extra/xz/src/xz/main.c40
-rw-r--r--Build/source/extra/xz/src/xz/message.c31
-rw-r--r--Build/source/extra/xz/src/xz/message.h2
-rw-r--r--Build/source/extra/xz/src/xz/options.c61
-rw-r--r--Build/source/extra/xz/src/xz/options.h7
-rw-r--r--Build/source/extra/xz/src/xz/private.h5
-rw-r--r--Build/source/extra/xz/src/xz/signals.c18
-rw-r--r--Build/source/extra/xz/src/xz/signals.h4
-rw-r--r--Build/source/extra/xz/src/xz/xz.1385
-rw-r--r--Build/source/extra/xz/src/xzdec/Makefile.in1
40 files changed, 979 insertions, 488 deletions
diff --git a/Build/source/extra/xz/src/Makefile.in b/Build/source/extra/xz/src/Makefile.in
index 78b24eca875..e9b73534c92 100644
--- a/Build/source/extra/xz/src/Makefile.in
+++ b/Build/source/extra/xz/src/Makefile.in
@@ -230,7 +230,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
diff --git a/Build/source/extra/xz/src/common/sysdefs.h b/Build/source/extra/xz/src/common/sysdefs.h
index 97a1c045cfb..1e138b1c2e7 100644
--- a/Build/source/extra/xz/src/common/sysdefs.h
+++ b/Build/source/extra/xz/src/common/sysdefs.h
@@ -102,11 +102,11 @@
# elif SIZEOF_SIZE_T == 8
# define SIZE_MAX UINT64_MAX
# else
-# error sizeof(size_t) is not 32-bit or 64-bit
+# error size_t is not 32-bit or 64-bit
# endif
#endif
#if SIZE_MAX != UINT32_MAX && SIZE_MAX != UINT64_MAX
-# error sizeof(size_t) is not 32-bit or 64-bit
+# error size_t is not 32-bit or 64-bit
#endif
#include <stdlib.h>
@@ -156,13 +156,11 @@ typedef unsigned char _Bool;
#undef memzero
#define memzero(s, n) memset(s, 0, n)
-#ifndef MIN
-# define MIN(x, y) ((x) < (y) ? (x) : (y))
-#endif
-
-#ifndef MAX
-# define MAX(x, y) ((x) > (y) ? (x) : (y))
-#endif
+// NOTE: Avoid using MIN() and MAX(), because even conditionally defining
+// those macros can cause some portability trouble, since on some systems
+// the system headers insist defining their own versions.
+#define my_min(x, y) ((x) < (y) ? (x) : (y))
+#define my_max(x, y) ((x) > (y) ? (x) : (y))
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
diff --git a/Build/source/extra/xz/src/liblzma/Makefile.am b/Build/source/extra/xz/src/liblzma/Makefile.am
index a4d2c1e6361..f6c572b2885 100644
--- a/Build/source/extra/xz/src/liblzma/Makefile.am
+++ b/Build/source/extra/xz/src/liblzma/Makefile.am
@@ -20,7 +20,6 @@ liblzma_la_CPPFLAGS = \
-I$(top_srcdir)/src/liblzma/lz \
-I$(top_srcdir)/src/liblzma/rangecoder \
-I$(top_srcdir)/src/liblzma/lzma \
- -I$(top_srcdir)/src/liblzma/subblock \
-I$(top_srcdir)/src/liblzma/delta \
-I$(top_srcdir)/src/liblzma/simple \
-I$(top_srcdir)/src/common \
@@ -39,10 +38,6 @@ include $(srcdir)/lzma/Makefile.inc
include $(srcdir)/rangecoder/Makefile.inc
endif
-if COND_FILTER_SUBBLOCK
-include $(srcdir)/subblock/Makefile.inc
-endif
-
if COND_FILTER_DELTA
include $(srcdir)/delta/Makefile.inc
endif
diff --git a/Build/source/extra/xz/src/liblzma/Makefile.in b/Build/source/extra/xz/src/liblzma/Makefile.in
index 74a9bb94225..4179c1b5467 100644
--- a/Build/source/extra/xz/src/liblzma/Makefile.in
+++ b/Build/source/extra/xz/src/liblzma/Makefile.in
@@ -40,7 +40,7 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/delta/Makefile.inc $(srcdir)/liblzma.pc.in \
$(srcdir)/lz/Makefile.inc $(srcdir)/lzma/Makefile.inc \
$(srcdir)/rangecoder/Makefile.inc \
- $(srcdir)/simple/Makefile.inc $(srcdir)/subblock/Makefile.inc
+ $(srcdir)/simple/Makefile.inc
@COND_MAIN_ENCODER_TRUE@am__append_1 = \
@COND_MAIN_ENCODER_TRUE@ common/alone_encoder.c \
@COND_MAIN_ENCODER_TRUE@ common/block_buffer_encoder.c \
@@ -143,52 +143,42 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
@COND_ENCODER_LZMA1_TRUE@@COND_FILTER_LZMA1_TRUE@ rangecoder/price_table.c
@COND_DECODER_LZMA1_TRUE@@COND_FILTER_LZMA1_TRUE@am__append_23 = rangecoder/range_decoder.h
-@COND_ENCODER_SUBBLOCK_TRUE@@COND_FILTER_SUBBLOCK_TRUE@am__append_24 = \
-@COND_ENCODER_SUBBLOCK_TRUE@@COND_FILTER_SUBBLOCK_TRUE@ subblock/subblock_encoder.c \
-@COND_ENCODER_SUBBLOCK_TRUE@@COND_FILTER_SUBBLOCK_TRUE@ subblock/subblock_encoder.h
-
-@COND_DECODER_SUBBLOCK_TRUE@@COND_FILTER_SUBBLOCK_TRUE@am__append_25 = \
-@COND_DECODER_SUBBLOCK_TRUE@@COND_FILTER_SUBBLOCK_TRUE@ subblock/subblock_decoder.c \
-@COND_DECODER_SUBBLOCK_TRUE@@COND_FILTER_SUBBLOCK_TRUE@ subblock/subblock_decoder.h \
-@COND_DECODER_SUBBLOCK_TRUE@@COND_FILTER_SUBBLOCK_TRUE@ subblock/subblock_decoder_helper.c \
-@COND_DECODER_SUBBLOCK_TRUE@@COND_FILTER_SUBBLOCK_TRUE@ subblock/subblock_decoder_helper.h
-
-@COND_FILTER_DELTA_TRUE@am__append_26 = \
+@COND_FILTER_DELTA_TRUE@am__append_24 = \
@COND_FILTER_DELTA_TRUE@ delta/delta_common.c \
@COND_FILTER_DELTA_TRUE@ delta/delta_common.h \
@COND_FILTER_DELTA_TRUE@ delta/delta_private.h
-@COND_ENCODER_DELTA_TRUE@@COND_FILTER_DELTA_TRUE@am__append_27 = \
+@COND_ENCODER_DELTA_TRUE@@COND_FILTER_DELTA_TRUE@am__append_25 = \
@COND_ENCODER_DELTA_TRUE@@COND_FILTER_DELTA_TRUE@ delta/delta_encoder.c \
@COND_ENCODER_DELTA_TRUE@@COND_FILTER_DELTA_TRUE@ delta/delta_encoder.h
-@COND_DECODER_DELTA_TRUE@@COND_FILTER_DELTA_TRUE@am__append_28 = \
+@COND_DECODER_DELTA_TRUE@@COND_FILTER_DELTA_TRUE@am__append_26 = \
@COND_DECODER_DELTA_TRUE@@COND_FILTER_DELTA_TRUE@ delta/delta_decoder.c \
@COND_DECODER_DELTA_TRUE@@COND_FILTER_DELTA_TRUE@ delta/delta_decoder.h
-@COND_FILTER_SIMPLE_TRUE@am__append_29 = \
+@COND_FILTER_SIMPLE_TRUE@am__append_27 = \
@COND_FILTER_SIMPLE_TRUE@ simple/simple_coder.c \
@COND_FILTER_SIMPLE_TRUE@ simple/simple_coder.h \
@COND_FILTER_SIMPLE_TRUE@ simple/simple_private.h
-@COND_ENCODER_SIMPLE_TRUE@@COND_FILTER_SIMPLE_TRUE@am__append_30 = \
+@COND_ENCODER_SIMPLE_TRUE@@COND_FILTER_SIMPLE_TRUE@am__append_28 = \
@COND_ENCODER_SIMPLE_TRUE@@COND_FILTER_SIMPLE_TRUE@ simple/simple_encoder.c \
@COND_ENCODER_SIMPLE_TRUE@@COND_FILTER_SIMPLE_TRUE@ simple/simple_encoder.h
-@COND_DECODER_SIMPLE_TRUE@@COND_FILTER_SIMPLE_TRUE@am__append_31 = \
+@COND_DECODER_SIMPLE_TRUE@@COND_FILTER_SIMPLE_TRUE@am__append_29 = \
@COND_DECODER_SIMPLE_TRUE@@COND_FILTER_SIMPLE_TRUE@ simple/simple_decoder.c \
@COND_DECODER_SIMPLE_TRUE@@COND_FILTER_SIMPLE_TRUE@ simple/simple_decoder.h
-@COND_FILTER_SIMPLE_TRUE@@COND_FILTER_X86_TRUE@am__append_32 = simple/x86.c
-@COND_FILTER_POWERPC_TRUE@@COND_FILTER_SIMPLE_TRUE@am__append_33 = simple/powerpc.c
-@COND_FILTER_IA64_TRUE@@COND_FILTER_SIMPLE_TRUE@am__append_34 = simple/ia64.c
-@COND_FILTER_ARM_TRUE@@COND_FILTER_SIMPLE_TRUE@am__append_35 = simple/arm.c
-@COND_FILTER_ARMTHUMB_TRUE@@COND_FILTER_SIMPLE_TRUE@am__append_36 = simple/armthumb.c
-@COND_FILTER_SIMPLE_TRUE@@COND_FILTER_SPARC_TRUE@am__append_37 = simple/sparc.c
-@COND_W32_TRUE@am__append_38 = liblzma.def liblzma.def.in empty.c
-@COND_W32_TRUE@am__append_39 = liblzma_w32res.rc
-@COND_W32_TRUE@am__append_40 = -Xlinker --output-def -Xlinker liblzma.def.in
-@COND_SHARED_TRUE@@COND_W32_TRUE@am__append_41 = liblzma.def
+@COND_FILTER_SIMPLE_TRUE@@COND_FILTER_X86_TRUE@am__append_30 = simple/x86.c
+@COND_FILTER_POWERPC_TRUE@@COND_FILTER_SIMPLE_TRUE@am__append_31 = simple/powerpc.c
+@COND_FILTER_IA64_TRUE@@COND_FILTER_SIMPLE_TRUE@am__append_32 = simple/ia64.c
+@COND_FILTER_ARM_TRUE@@COND_FILTER_SIMPLE_TRUE@am__append_33 = simple/arm.c
+@COND_FILTER_ARMTHUMB_TRUE@@COND_FILTER_SIMPLE_TRUE@am__append_34 = simple/armthumb.c
+@COND_FILTER_SIMPLE_TRUE@@COND_FILTER_SPARC_TRUE@am__append_35 = simple/sparc.c
+@COND_W32_TRUE@am__append_36 = liblzma.def liblzma.def.in empty.c
+@COND_W32_TRUE@am__append_37 = liblzma_w32res.rc
+@COND_W32_TRUE@am__append_38 = -Xlinker --output-def -Xlinker liblzma.def.in
+@COND_SHARED_TRUE@@COND_W32_TRUE@am__append_39 = liblzma.def
subdir = src/liblzma
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \
@@ -278,10 +268,7 @@ am__liblzma_la_SOURCES_DIST = \
lzma/lzma2_encoder.h lzma/lzma2_decoder.c lzma/lzma2_decoder.h \
rangecoder/range_common.h rangecoder/range_encoder.h \
rangecoder/price.h rangecoder/price_table.c \
- rangecoder/range_decoder.h subblock/subblock_encoder.c \
- subblock/subblock_encoder.h subblock/subblock_decoder.c \
- subblock/subblock_decoder.h subblock/subblock_decoder_helper.c \
- subblock/subblock_decoder_helper.h delta/delta_common.c \
+ rangecoder/range_decoder.h delta/delta_common.c \
delta/delta_common.h delta/delta_private.h \
delta/delta_encoder.c delta/delta_encoder.h \
delta/delta_decoder.c delta/delta_decoder.h \
@@ -343,22 +330,19 @@ am__objects_14 =
@COND_ENCODER_LZMA2_TRUE@@COND_FILTER_LZMA1_TRUE@am__objects_18 = liblzma_la-lzma2_encoder.lo
@COND_DECODER_LZMA2_TRUE@@COND_FILTER_LZMA1_TRUE@am__objects_19 = liblzma_la-lzma2_decoder.lo
@COND_ENCODER_LZMA1_TRUE@@COND_FILTER_LZMA1_TRUE@am__objects_20 = liblzma_la-price_table.lo
-@COND_ENCODER_SUBBLOCK_TRUE@@COND_FILTER_SUBBLOCK_TRUE@am__objects_21 = liblzma_la-subblock_encoder.lo
-@COND_DECODER_SUBBLOCK_TRUE@@COND_FILTER_SUBBLOCK_TRUE@am__objects_22 = liblzma_la-subblock_decoder.lo \
-@COND_DECODER_SUBBLOCK_TRUE@@COND_FILTER_SUBBLOCK_TRUE@ liblzma_la-subblock_decoder_helper.lo
-@COND_FILTER_DELTA_TRUE@am__objects_23 = liblzma_la-delta_common.lo
-@COND_ENCODER_DELTA_TRUE@@COND_FILTER_DELTA_TRUE@am__objects_24 = liblzma_la-delta_encoder.lo
-@COND_DECODER_DELTA_TRUE@@COND_FILTER_DELTA_TRUE@am__objects_25 = liblzma_la-delta_decoder.lo
-@COND_FILTER_SIMPLE_TRUE@am__objects_26 = liblzma_la-simple_coder.lo
-@COND_ENCODER_SIMPLE_TRUE@@COND_FILTER_SIMPLE_TRUE@am__objects_27 = liblzma_la-simple_encoder.lo
-@COND_DECODER_SIMPLE_TRUE@@COND_FILTER_SIMPLE_TRUE@am__objects_28 = liblzma_la-simple_decoder.lo
-@COND_FILTER_SIMPLE_TRUE@@COND_FILTER_X86_TRUE@am__objects_29 = liblzma_la-x86.lo
-@COND_FILTER_POWERPC_TRUE@@COND_FILTER_SIMPLE_TRUE@am__objects_30 = liblzma_la-powerpc.lo
-@COND_FILTER_IA64_TRUE@@COND_FILTER_SIMPLE_TRUE@am__objects_31 = liblzma_la-ia64.lo
-@COND_FILTER_ARM_TRUE@@COND_FILTER_SIMPLE_TRUE@am__objects_32 = liblzma_la-arm.lo
-@COND_FILTER_ARMTHUMB_TRUE@@COND_FILTER_SIMPLE_TRUE@am__objects_33 = liblzma_la-armthumb.lo
-@COND_FILTER_SIMPLE_TRUE@@COND_FILTER_SPARC_TRUE@am__objects_34 = liblzma_la-sparc.lo
-@COND_W32_TRUE@am__objects_35 = liblzma_w32res.lo
+@COND_FILTER_DELTA_TRUE@am__objects_21 = liblzma_la-delta_common.lo
+@COND_ENCODER_DELTA_TRUE@@COND_FILTER_DELTA_TRUE@am__objects_22 = liblzma_la-delta_encoder.lo
+@COND_DECODER_DELTA_TRUE@@COND_FILTER_DELTA_TRUE@am__objects_23 = liblzma_la-delta_decoder.lo
+@COND_FILTER_SIMPLE_TRUE@am__objects_24 = liblzma_la-simple_coder.lo
+@COND_ENCODER_SIMPLE_TRUE@@COND_FILTER_SIMPLE_TRUE@am__objects_25 = liblzma_la-simple_encoder.lo
+@COND_DECODER_SIMPLE_TRUE@@COND_FILTER_SIMPLE_TRUE@am__objects_26 = liblzma_la-simple_decoder.lo
+@COND_FILTER_SIMPLE_TRUE@@COND_FILTER_X86_TRUE@am__objects_27 = liblzma_la-x86.lo
+@COND_FILTER_POWERPC_TRUE@@COND_FILTER_SIMPLE_TRUE@am__objects_28 = liblzma_la-powerpc.lo
+@COND_FILTER_IA64_TRUE@@COND_FILTER_SIMPLE_TRUE@am__objects_29 = liblzma_la-ia64.lo
+@COND_FILTER_ARM_TRUE@@COND_FILTER_SIMPLE_TRUE@am__objects_30 = liblzma_la-arm.lo
+@COND_FILTER_ARMTHUMB_TRUE@@COND_FILTER_SIMPLE_TRUE@am__objects_31 = liblzma_la-armthumb.lo
+@COND_FILTER_SIMPLE_TRUE@@COND_FILTER_SPARC_TRUE@am__objects_32 = liblzma_la-sparc.lo
+@COND_W32_TRUE@am__objects_33 = liblzma_w32res.lo
am_liblzma_la_OBJECTS = liblzma_la-tuklib_physmem.lo \
liblzma_la-common.lo liblzma_la-block_util.lo \
liblzma_la-easy_preset.lo liblzma_la-filter_common.lo \
@@ -375,8 +359,7 @@ am_liblzma_la_OBJECTS = liblzma_la-tuklib_physmem.lo \
$(am__objects_22) $(am__objects_23) $(am__objects_24) \
$(am__objects_25) $(am__objects_26) $(am__objects_27) \
$(am__objects_28) $(am__objects_29) $(am__objects_30) \
- $(am__objects_31) $(am__objects_32) $(am__objects_33) \
- $(am__objects_34) $(am__objects_35)
+ $(am__objects_31) $(am__objects_32) $(am__objects_33)
liblzma_la_OBJECTS = $(am_liblzma_la_OBJECTS)
liblzma_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
@@ -574,7 +557,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@@ -594,8 +576,8 @@ xz = @xz@
SUBDIRS = api
EXTRA_DIST = check/crc32_tablegen.c check/crc64_tablegen.c \
$(am__append_14) liblzma.pc.in
-CLEANFILES = $(am__append_38)
-doc_DATA = $(am__append_41)
+CLEANFILES = $(am__append_36)
+doc_DATA = $(am__append_39)
lib_LTLIBRARIES = liblzma.la
liblzma_la_SOURCES = $(top_srcdir)/src/common/tuklib_physmem.c \
common/common.c common/common.h common/block_util.c \
@@ -615,8 +597,7 @@ liblzma_la_SOURCES = $(top_srcdir)/src/common/tuklib_physmem.c \
$(am__append_26) $(am__append_27) $(am__append_28) \
$(am__append_29) $(am__append_30) $(am__append_31) \
$(am__append_32) $(am__append_33) $(am__append_34) \
- $(am__append_35) $(am__append_36) $(am__append_37) \
- $(am__append_39)
+ $(am__append_35) $(am__append_37)
liblzma_la_CPPFLAGS = \
-I$(top_srcdir)/src/liblzma/api \
-I$(top_srcdir)/src/liblzma/common \
@@ -624,21 +605,20 @@ liblzma_la_CPPFLAGS = \
-I$(top_srcdir)/src/liblzma/lz \
-I$(top_srcdir)/src/liblzma/rangecoder \
-I$(top_srcdir)/src/liblzma/lzma \
- -I$(top_srcdir)/src/liblzma/subblock \
-I$(top_srcdir)/src/liblzma/delta \
-I$(top_srcdir)/src/liblzma/simple \
-I$(top_srcdir)/src/common \
-DTUKLIB_SYMBOL_PREFIX=lzma_
liblzma_la_LDFLAGS = -no-undefined -version-info 0:0:0 \
- $(am__append_40)
+ $(am__append_38)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = liblzma.pc
all: all-recursive
.SUFFIXES:
.SUFFIXES: .S .c .lo .o .obj .rc
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/common/Makefile.inc $(srcdir)/check/Makefile.inc $(srcdir)/lz/Makefile.inc $(srcdir)/lzma/Makefile.inc $(srcdir)/rangecoder/Makefile.inc $(srcdir)/subblock/Makefile.inc $(srcdir)/delta/Makefile.inc $(srcdir)/simple/Makefile.inc $(am__configure_deps)
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/common/Makefile.inc $(srcdir)/check/Makefile.inc $(srcdir)/lz/Makefile.inc $(srcdir)/lzma/Makefile.inc $(srcdir)/rangecoder/Makefile.inc $(srcdir)/delta/Makefile.inc $(srcdir)/simple/Makefile.inc $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -778,9 +758,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblzma_la-stream_flags_common.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblzma_la-stream_flags_decoder.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblzma_la-stream_flags_encoder.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblzma_la-subblock_decoder.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblzma_la-subblock_decoder_helper.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblzma_la-subblock_encoder.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblzma_la-tuklib_physmem.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblzma_la-vli_decoder.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblzma_la-vli_encoder.Plo@am__quote@
@@ -1256,27 +1233,6 @@ liblzma_la-price_table.lo: rangecoder/price_table.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblzma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblzma_la-price_table.lo `test -f 'rangecoder/price_table.c' || echo '$(srcdir)/'`rangecoder/price_table.c
-liblzma_la-subblock_encoder.lo: subblock/subblock_encoder.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblzma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblzma_la-subblock_encoder.lo -MD -MP -MF $(DEPDIR)/liblzma_la-subblock_encoder.Tpo -c -o liblzma_la-subblock_encoder.lo `test -f 'subblock/subblock_encoder.c' || echo '$(srcdir)/'`subblock/subblock_encoder.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblzma_la-subblock_encoder.Tpo $(DEPDIR)/liblzma_la-subblock_encoder.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='subblock/subblock_encoder.c' object='liblzma_la-subblock_encoder.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblzma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblzma_la-subblock_encoder.lo `test -f 'subblock/subblock_encoder.c' || echo '$(srcdir)/'`subblock/subblock_encoder.c
-
-liblzma_la-subblock_decoder.lo: subblock/subblock_decoder.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblzma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblzma_la-subblock_decoder.lo -MD -MP -MF $(DEPDIR)/liblzma_la-subblock_decoder.Tpo -c -o liblzma_la-subblock_decoder.lo `test -f 'subblock/subblock_decoder.c' || echo '$(srcdir)/'`subblock/subblock_decoder.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblzma_la-subblock_decoder.Tpo $(DEPDIR)/liblzma_la-subblock_decoder.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='subblock/subblock_decoder.c' object='liblzma_la-subblock_decoder.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblzma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblzma_la-subblock_decoder.lo `test -f 'subblock/subblock_decoder.c' || echo '$(srcdir)/'`subblock/subblock_decoder.c
-
-liblzma_la-subblock_decoder_helper.lo: subblock/subblock_decoder_helper.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblzma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblzma_la-subblock_decoder_helper.lo -MD -MP -MF $(DEPDIR)/liblzma_la-subblock_decoder_helper.Tpo -c -o liblzma_la-subblock_decoder_helper.lo `test -f 'subblock/subblock_decoder_helper.c' || echo '$(srcdir)/'`subblock/subblock_decoder_helper.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblzma_la-subblock_decoder_helper.Tpo $(DEPDIR)/liblzma_la-subblock_decoder_helper.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='subblock/subblock_decoder_helper.c' object='liblzma_la-subblock_decoder_helper.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblzma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblzma_la-subblock_decoder_helper.lo `test -f 'subblock/subblock_decoder_helper.c' || echo '$(srcdir)/'`subblock/subblock_decoder_helper.c
-
liblzma_la-delta_common.lo: delta/delta_common.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblzma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblzma_la-delta_common.lo -MD -MP -MF $(DEPDIR)/liblzma_la-delta_common.Tpo -c -o liblzma_la-delta_common.lo `test -f 'delta/delta_common.c' || echo '$(srcdir)/'`delta/delta_common.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblzma_la-delta_common.Tpo $(DEPDIR)/liblzma_la-delta_common.Plo
diff --git a/Build/source/extra/xz/src/liblzma/api/Makefile.am b/Build/source/extra/xz/src/liblzma/api/Makefile.am
index 4536b0ac320..e016de5855c 100644
--- a/Build/source/extra/xz/src/liblzma/api/Makefile.am
+++ b/Build/source/extra/xz/src/liblzma/api/Makefile.am
@@ -19,6 +19,5 @@ nobase_include_HEADERS = \
lzma/index_hash.h \
lzma/lzma.h \
lzma/stream_flags.h \
- lzma/subblock.h \
lzma/version.h \
lzma/vli.h
diff --git a/Build/source/extra/xz/src/liblzma/api/Makefile.in b/Build/source/extra/xz/src/liblzma/api/Makefile.in
index 810f3bf0cc7..186506cd876 100644
--- a/Build/source/extra/xz/src/liblzma/api/Makefile.in
+++ b/Build/source/extra/xz/src/liblzma/api/Makefile.in
@@ -217,7 +217,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
@@ -248,7 +247,6 @@ nobase_include_HEADERS = \
lzma/index_hash.h \
lzma/lzma.h \
lzma/stream_flags.h \
- lzma/subblock.h \
lzma/version.h \
lzma/vli.h
diff --git a/Build/source/extra/xz/src/liblzma/api/lzma.h b/Build/source/extra/xz/src/liblzma/api/lzma.h
index 84279211cf3..fb593a35a07 100644
--- a/Build/source/extra/xz/src/liblzma/api/lzma.h
+++ b/Build/source/extra/xz/src/liblzma/api/lzma.h
@@ -284,7 +284,6 @@ extern "C" {
/* Filters */
#include "lzma/filter.h"
-#include "lzma/subblock.h"
#include "lzma/bcj.h"
#include "lzma/delta.h"
#include "lzma/lzma.h"
diff --git a/Build/source/extra/xz/src/liblzma/api/lzma/index.h b/Build/source/extra/xz/src/liblzma/api/lzma/index.h
index a0469b23c34..5ea12e359e5 100644
--- a/Build/source/extra/xz/src/liblzma/api/lzma/index.h
+++ b/Build/source/extra/xz/src/liblzma/api/lzma/index.h
@@ -368,7 +368,7 @@ extern LZMA_API(lzma_ret) lzma_index_stream_flags(
/**
* \brief Get the types of integrity Checks
*
- * If lzma_index_stream_padding() is used to set the Stream Flags for
+ * If lzma_index_stream_flags() is used to set the Stream Flags for
* every Stream, lzma_index_checks() can be used to get a bitmask to
* indicate which Check types have been used. It can be useful e.g. if
* showing the Check types to the user.
diff --git a/Build/source/extra/xz/src/liblzma/common/block_buffer_encoder.c b/Build/source/extra/xz/src/liblzma/common/block_buffer_encoder.c
index 4d90feef50b..a8f71c2140e 100644
--- a/Build/source/extra/xz/src/liblzma/common/block_buffer_encoder.c
+++ b/Build/source/extra/xz/src/liblzma/common/block_buffer_encoder.c
@@ -139,7 +139,7 @@ block_encode_uncompressed(lzma_block *block, const uint8_t *in, size_t in_size,
// Size of the uncompressed chunk
const size_t copy_size
- = MIN(in_size - in_pos, LZMA2_CHUNK_MAX);
+ = my_min(in_size - in_pos, LZMA2_CHUNK_MAX);
out[(*out_pos)++] = (copy_size - 1) >> 8;
out[(*out_pos)++] = (copy_size - 1) & 0xFF;
diff --git a/Build/source/extra/xz/src/liblzma/common/block_util.c b/Build/source/extra/xz/src/liblzma/common/block_util.c
index cb9cde255e6..62c934547c9 100644
--- a/Build/source/extra/xz/src/liblzma/common/block_util.c
+++ b/Build/source/extra/xz/src/liblzma/common/block_util.c
@@ -15,7 +15,7 @@
extern LZMA_API(lzma_ret)
-lzma_block_compressed_size(lzma_block *block, lzma_vli total_size)
+lzma_block_compressed_size(lzma_block *block, lzma_vli unpadded_size)
{
// Validate everything but Uncompressed Size and filters.
if (lzma_block_unpadded_size(block) == 0)
@@ -25,13 +25,13 @@ lzma_block_compressed_size(lzma_block *block, lzma_vli total_size)
+ lzma_check_size(block->check);
// Validate that Compressed Size will be greater than zero.
- if (container_size <= total_size)
+ if (unpadded_size <= container_size)
return LZMA_DATA_ERROR;
// Calculate what Compressed Size is supposed to be.
// If Compressed Size was present in Block Header,
// compare that the new value matches it.
- const lzma_vli compressed_size = total_size - container_size;
+ const lzma_vli compressed_size = unpadded_size - container_size;
if (block->compressed_size != LZMA_VLI_UNKNOWN
&& block->compressed_size != compressed_size)
return LZMA_DATA_ERROR;
diff --git a/Build/source/extra/xz/src/liblzma/common/common.c b/Build/source/extra/xz/src/liblzma/common/common.c
index 2f185e490d4..07b1d4763f6 100644
--- a/Build/source/extra/xz/src/liblzma/common/common.c
+++ b/Build/source/extra/xz/src/liblzma/common/common.c
@@ -76,7 +76,7 @@ lzma_bufcpy(const uint8_t *restrict in, size_t *restrict in_pos,
{
const size_t in_avail = in_size - *in_pos;
const size_t out_avail = out_size - *out_pos;
- const size_t copy_size = MIN(in_avail, out_avail);
+ const size_t copy_size = my_min(in_avail, out_avail);
memcpy(out + *out_pos, in + *in_pos, copy_size);
diff --git a/Build/source/extra/xz/src/liblzma/common/common.h b/Build/source/extra/xz/src/liblzma/common/common.h
index 7b7fbb11c3d..3a85168f13b 100644
--- a/Build/source/extra/xz/src/liblzma/common/common.h
+++ b/Build/source/extra/xz/src/liblzma/common/common.h
@@ -60,12 +60,6 @@
#define LZMA_FILTER_RESERVED_START (LZMA_VLI_C(1) << 62)
-/// Internal helper filter used by Subblock decoder. It is mapped to an
-/// otherwise invalid Filter ID, which is impossible to get from any input
-/// file (even if malicious file).
-#define LZMA_FILTER_SUBBLOCK_HELPER LZMA_VLI_C(0x7000000000000001)
-
-
/// Supported flags that can be passed to lzma_stream_decoder()
/// or lzma_auto_decoder().
#define LZMA_SUPPORTED_FLAGS \
diff --git a/Build/source/extra/xz/src/liblzma/common/filter_common.c b/Build/source/extra/xz/src/liblzma/common/filter_common.c
index 2322d7deec9..b157c6280f8 100644
--- a/Build/source/extra/xz/src/liblzma/common/filter_common.c
+++ b/Build/source/extra/xz/src/liblzma/common/filter_common.c
@@ -52,15 +52,6 @@ static const struct {
.changes_size = true,
},
#endif
-#if defined(HAVE_ENCODER_SUBBLOCK) || defined(HAVE_DECODER_SUBBLOCK)
- {
- .id = LZMA_FILTER_SUBBLOCK,
- .options_size = sizeof(lzma_options_subblock),
- .non_last_ok = true,
- .last_ok = true,
- .changes_size = true,
- },
-#endif
#ifdef HAVE_DECODER_X86
{
.id = LZMA_FILTER_X86,
diff --git a/Build/source/extra/xz/src/liblzma/common/filter_decoder.c b/Build/source/extra/xz/src/liblzma/common/filter_decoder.c
index 95f77b76cf7..1ebbe2afef0 100644
--- a/Build/source/extra/xz/src/liblzma/common/filter_decoder.c
+++ b/Build/source/extra/xz/src/liblzma/common/filter_decoder.c
@@ -14,8 +14,6 @@
#include "filter_common.h"
#include "lzma_decoder.h"
#include "lzma2_decoder.h"
-#include "subblock_decoder.h"
-#include "subblock_decoder_helper.h"
#include "simple_decoder.h"
#include "delta_decoder.h"
@@ -60,20 +58,6 @@ static const lzma_filter_decoder decoders[] = {
.props_decode = &lzma_lzma2_props_decode,
},
#endif
-#ifdef HAVE_DECODER_SUBBLOCK
- {
- .id = LZMA_FILTER_SUBBLOCK,
- .init = &lzma_subblock_decoder_init,
-// .memusage = &lzma_subblock_decoder_memusage,
- .props_decode = NULL,
- },
- {
- .id = LZMA_FILTER_SUBBLOCK_HELPER,
- .init = &lzma_subblock_decoder_helper_init,
- .memusage = NULL,
- .props_decode = NULL,
- },
-#endif
#ifdef HAVE_DECODER_X86
{
.id = LZMA_FILTER_X86,
diff --git a/Build/source/extra/xz/src/liblzma/common/filter_encoder.c b/Build/source/extra/xz/src/liblzma/common/filter_encoder.c
index ab3d3af15e2..436d2cc6e42 100644
--- a/Build/source/extra/xz/src/liblzma/common/filter_encoder.c
+++ b/Build/source/extra/xz/src/liblzma/common/filter_encoder.c
@@ -14,7 +14,6 @@
#include "filter_common.h"
#include "lzma_encoder.h"
#include "lzma2_encoder.h"
-#include "subblock_encoder.h"
#include "simple_encoder.h"
#include "delta_encoder.h"
@@ -77,17 +76,6 @@ static const lzma_filter_encoder encoders[] = {
.props_encode = &lzma_lzma2_props_encode,
},
#endif
-#ifdef HAVE_ENCODER_SUBBLOCK
- {
- .id = LZMA_FILTER_SUBBLOCK,
- .init = &lzma_subblock_encoder_init,
-// .memusage = &lzma_subblock_encoder_memusage,
- .chunk_size = NULL,
- .props_size_get = NULL,
- .props_size_fixed = 0,
- .props_encode = NULL,
- },
-#endif
#ifdef HAVE_ENCODER_X86
{
.id = LZMA_FILTER_X86,
diff --git a/Build/source/extra/xz/src/liblzma/common/stream_buffer_encoder.c b/Build/source/extra/xz/src/liblzma/common/stream_buffer_encoder.c
index bbafaa6d01d..f727d8542b3 100644
--- a/Build/source/extra/xz/src/liblzma/common/stream_buffer_encoder.c
+++ b/Build/source/extra/xz/src/liblzma/common/stream_buffer_encoder.c
@@ -33,7 +33,7 @@ lzma_stream_buffer_bound(size_t uncompressed_size)
// Catch the possible integer overflow and also prevent the size of
// the Stream exceeding LZMA_VLI_MAX (theoretically possible on
// 64-bit systems).
- if (MIN(SIZE_MAX, LZMA_VLI_MAX) - block_bound < HEADERS_BOUND)
+ if (my_min(SIZE_MAX, LZMA_VLI_MAX) - block_bound < HEADERS_BOUND)
return 0;
return block_bound + HEADERS_BOUND;
diff --git a/Build/source/extra/xz/src/liblzma/delta/delta_encoder.c b/Build/source/extra/xz/src/liblzma/delta/delta_encoder.c
index 80d0d1764dd..ea1cc2cb020 100644
--- a/Build/source/extra/xz/src/liblzma/delta/delta_encoder.c
+++ b/Build/source/extra/xz/src/liblzma/delta/delta_encoder.c
@@ -59,7 +59,7 @@ delta_encode(lzma_coder *coder, lzma_allocator *allocator,
if (coder->next.code == NULL) {
const size_t in_avail = in_size - *in_pos;
const size_t out_avail = out_size - *out_pos;
- const size_t size = MIN(in_avail, out_avail);
+ const size_t size = my_min(in_avail, out_avail);
copy_and_encode(coder, in + *in_pos, out + *out_pos, size);
diff --git a/Build/source/extra/xz/src/liblzma/lz/lz_decoder.c b/Build/source/extra/xz/src/liblzma/lz/lz_decoder.c
index 350b1f89812..2c57355125f 100644
--- a/Build/source/extra/xz/src/liblzma/lz/lz_decoder.c
+++ b/Build/source/extra/xz/src/liblzma/lz/lz_decoder.c
@@ -81,8 +81,9 @@ decode_buffer(lzma_coder *coder,
// It must not decode past the end of the dictionary
// buffer, and we don't want it to decode more than is
// actually needed to fill the out[] buffer.
- coder->dict.limit = coder->dict.pos + MIN(out_size - *out_pos,
- coder->dict.size - coder->dict.pos);
+ coder->dict.limit = coder->dict.pos
+ + my_min(out_size - *out_pos,
+ coder->dict.size - coder->dict.pos);
// Call the coder->lz.code() to do the actual decoding.
const lzma_ret ret = coder->lz.code(
@@ -264,7 +265,7 @@ lzma_lz_decoder_init(lzma_next_coder *next, lzma_allocator *allocator,
&& lz_options.preset_dict_size > 0) {
// If the preset dictionary is bigger than the actual
// dictionary, copy only the tail.
- const size_t copy_size = MIN(lz_options.preset_dict_size,
+ const size_t copy_size = my_min(lz_options.preset_dict_size,
lz_options.dict_size);
const size_t offset = lz_options.preset_dict_size - copy_size;
memcpy(next->coder->dict.buf, lz_options.preset_dict + offset,
diff --git a/Build/source/extra/xz/src/liblzma/lz/lz_decoder.h b/Build/source/extra/xz/src/liblzma/lz/lz_decoder.h
index bf1609dbedf..7266e803165 100644
--- a/Build/source/extra/xz/src/liblzma/lz/lz_decoder.h
+++ b/Build/source/extra/xz/src/liblzma/lz/lz_decoder.h
@@ -129,7 +129,7 @@ dict_repeat(lzma_dict *dict, uint32_t distance, uint32_t *len)
{
// Don't write past the end of the dictionary.
const size_t dict_avail = dict->limit - dict->pos;
- uint32_t left = MIN(dict_avail, *len);
+ uint32_t left = my_min(dict_avail, *len);
*len -= left;
// Repeat a block of data from the history. Because memcpy() is faster
diff --git a/Build/source/extra/xz/src/liblzma/lz/lz_encoder.c b/Build/source/extra/xz/src/liblzma/lz/lz_encoder.c
index 757e53749c4..9e980a2c71d 100644
--- a/Build/source/extra/xz/src/liblzma/lz/lz_encoder.c
+++ b/Build/source/extra/xz/src/liblzma/lz/lz_encoder.c
@@ -341,7 +341,7 @@ lz_encoder_prepare(lzma_mf *mf, lzma_allocator *allocator,
// Deallocate the old hash array if it exists and has different size
// than what is needed now.
- if (mf->hash != NULL && old_count != new_count) {
+ if (old_count != new_count) {
lzma_free(mf->hash, allocator);
mf->hash = NULL;
}
@@ -423,7 +423,7 @@ lz_encoder_init(lzma_mf *mf, lzma_allocator *allocator,
&& lz_options->preset_dict_size > 0) {
// If the preset dictionary is bigger than the actual
// dictionary, use only the tail.
- mf->write_pos = MIN(lz_options->preset_dict_size, mf->size);
+ mf->write_pos = my_min(lz_options->preset_dict_size, mf->size);
memcpy(mf->buffer, lz_options->preset_dict
+ lz_options->preset_dict_size - mf->write_pos,
mf->write_pos);
@@ -444,6 +444,8 @@ lzma_lz_encoder_memusage(const lzma_lz_options *lz_options)
lzma_mf mf = {
.buffer = NULL,
.hash = NULL,
+ .hash_size_sum = 0,
+ .sons_count = 0,
};
// Setup the size information into mf.
@@ -519,6 +521,8 @@ lzma_lz_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
next->coder->mf.buffer = NULL;
next->coder->mf.hash = NULL;
+ next->coder->mf.hash_size_sum = 0;
+ next->coder->mf.sons_count = 0;
next->coder->next = LZMA_NEXT_CODER_INIT;
}
diff --git a/Build/source/extra/xz/src/liblzma/lz/lz_encoder.h b/Build/source/extra/xz/src/liblzma/lz/lz_encoder.h
index f6352a47227..741c4532280 100644
--- a/Build/source/extra/xz/src/liblzma/lz/lz_encoder.h
+++ b/Build/source/extra/xz/src/liblzma/lz/lz_encoder.h
@@ -281,7 +281,7 @@ mf_read(lzma_mf *mf, uint8_t *out, size_t *out_pos, size_t out_size,
size_t *left)
{
const size_t out_avail = out_size - *out_pos;
- const size_t copy_size = MIN(out_avail, *left);
+ const size_t copy_size = my_min(out_avail, *left);
assert(mf->read_ahead == 0);
assert(mf->read_pos >= *left);
diff --git a/Build/source/extra/xz/src/liblzma/lz/lz_encoder_mf.c b/Build/source/extra/xz/src/liblzma/lz/lz_encoder_mf.c
index b31b08578d4..f82a1c1d295 100644
--- a/Build/source/extra/xz/src/liblzma/lz/lz_encoder_mf.c
+++ b/Build/source/extra/xz/src/liblzma/lz/lz_encoder_mf.c
@@ -481,7 +481,7 @@ bt_find_func(
<< 1);
const uint8_t *const pb = cur - delta;
- uint32_t len = MIN(len0, len1);
+ uint32_t len = my_min(len0, len1);
if (pb[len] == cur[len]) {
while (++len != len_limit)
@@ -546,7 +546,7 @@ bt_skip_func(
+ (delta > cyclic_pos ? cyclic_size : 0))
<< 1);
const uint8_t *pb = cur - delta;
- uint32_t len = MIN(len0, len1);
+ uint32_t len = my_min(len0, len1);
if (pb[len] == cur[len]) {
while (++len != len_limit)
diff --git a/Build/source/extra/xz/src/liblzma/lzma/lzma2_encoder.c b/Build/source/extra/xz/src/liblzma/lzma/lzma2_encoder.c
index 1e0569a4a95..b48e0d6894f 100644
--- a/Build/source/extra/xz/src/liblzma/lzma/lzma2_encoder.c
+++ b/Build/source/extra/xz/src/liblzma/lzma/lzma2_encoder.c
@@ -372,7 +372,7 @@ extern lzma_ret
lzma_lzma2_props_encode(const void *options, uint8_t *out)
{
const lzma_options_lzma *const opt = options;
- uint32_t d = MAX(opt->dict_size, LZMA_DICT_SIZE_MIN);
+ uint32_t d = my_max(opt->dict_size, LZMA_DICT_SIZE_MIN);
// Round up to to the next 2^n - 1 or 2^n + 2^(n - 1) - 1 depending
// on which one is the next:
diff --git a/Build/source/extra/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c b/Build/source/extra/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c
index 4ca55b60028..f835f69356b 100644
--- a/Build/source/extra/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c
+++ b/Build/source/extra/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c
@@ -33,7 +33,7 @@ lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
}
const uint8_t *buf = mf_ptr(mf) - 1;
- const uint32_t buf_avail = MIN(mf_avail(mf) + 1, MATCH_LEN_MAX);
+ const uint32_t buf_avail = my_min(mf_avail(mf) + 1, MATCH_LEN_MAX);
if (buf_avail < 2) {
// There's not enough input left to encode a match.
diff --git a/Build/source/extra/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c b/Build/source/extra/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c
index 9284c8a2896..7e856493c8c 100644
--- a/Build/source/extra/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c
+++ b/Build/source/extra/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c
@@ -287,7 +287,7 @@ helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
matches_count = coder->matches_count;
}
- const uint32_t buf_avail = MIN(mf_avail(mf) + 1, MATCH_LEN_MAX);
+ const uint32_t buf_avail = my_min(mf_avail(mf) + 1, MATCH_LEN_MAX);
if (buf_avail < 2) {
*back_res = UINT32_MAX;
*len_res = 1;
@@ -371,7 +371,7 @@ helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
}
}
- const uint32_t len_end = MAX(len_main, rep_lens[rep_max_index]);
+ const uint32_t len_end = my_max(len_main, rep_lens[rep_max_index]);
if (len_end < 2) {
*back_res = coder->opts[1].back_prev;
@@ -565,12 +565,12 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
if (buf_avail_full < 2)
return len_end;
- const uint32_t buf_avail = MIN(buf_avail_full, nice_len);
+ const uint32_t buf_avail = my_min(buf_avail_full, nice_len);
if (!next_is_literal && match_byte != current_byte) { // speed optimization
// try literal + rep0
const uint8_t *const buf_back = buf - reps[0] - 1;
- const uint32_t limit = MIN(buf_avail_full, nice_len + 1);
+ const uint32_t limit = my_min(buf_avail_full, nice_len + 1);
uint32_t len_test = 1;
while (len_test < limit && buf[len_test] == buf_back[len_test])
@@ -648,7 +648,7 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
uint32_t len_test_2 = len_test + 1;
- const uint32_t limit = MIN(buf_avail_full,
+ const uint32_t limit = my_min(buf_avail_full,
len_test_2 + nice_len);
for (; len_test_2 < limit
&& buf[len_test_2] == buf_back[len_test_2];
@@ -743,7 +743,7 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
// Try Match + Literal + Rep0
const uint8_t *const buf_back = buf - cur_back - 1;
uint32_t len_test_2 = len_test + 1;
- const uint32_t limit = MIN(buf_avail_full,
+ const uint32_t limit = my_min(buf_avail_full,
len_test_2 + nice_len);
for (; len_test_2 < limit &&
@@ -860,7 +860,7 @@ lzma_lzma_optimum_normal(lzma_coder *restrict coder, lzma_mf *restrict mf,
len_end = helper2(coder, reps, mf_ptr(mf) - 1, len_end,
position + cur, cur, mf->nice_len,
- MIN(mf_avail(mf) + 1, OPTS - 1 - cur));
+ my_min(mf_avail(mf) + 1, OPTS - 1 - cur));
}
backward(coder, len_res, back_res, cur);
diff --git a/Build/source/extra/xz/src/lzmainfo/Makefile.in b/Build/source/extra/xz/src/lzmainfo/Makefile.in
index 758705e2d2b..b5c08c1035b 100644
--- a/Build/source/extra/xz/src/lzmainfo/Makefile.in
+++ b/Build/source/extra/xz/src/lzmainfo/Makefile.in
@@ -245,7 +245,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
diff --git a/Build/source/extra/xz/src/scripts/Makefile.in b/Build/source/extra/xz/src/scripts/Makefile.in
index 4cb73efefbd..bd6ff405be1 100644
--- a/Build/source/extra/xz/src/scripts/Makefile.in
+++ b/Build/source/extra/xz/src/scripts/Makefile.in
@@ -219,7 +219,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
diff --git a/Build/source/extra/xz/src/xz/Makefile.in b/Build/source/extra/xz/src/xz/Makefile.in
index a88edca72d5..8ff44cb0c8a 100644
--- a/Build/source/extra/xz/src/xz/Makefile.in
+++ b/Build/source/extra/xz/src/xz/Makefile.in
@@ -259,7 +259,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
diff --git a/Build/source/extra/xz/src/xz/args.c b/Build/source/extra/xz/src/xz/args.c
index f37f80244b4..7b12529c06d 100644
--- a/Build/source/extra/xz/src/xz/args.c
+++ b/Build/source/extra/xz/src/xz/args.c
@@ -32,8 +32,7 @@ static void
parse_real(args_info *args, int argc, char **argv)
{
enum {
- OPT_SUBBLOCK = INT_MIN,
- OPT_X86,
+ OPT_X86 = INT_MIN,
OPT_POWERPC,
OPT_IA64,
OPT_ARM,
@@ -92,7 +91,6 @@ parse_real(args_info *args, int argc, char **argv)
{ "armthumb", optional_argument, NULL, OPT_ARMTHUMB },
{ "sparc", optional_argument, NULL, OPT_SPARC },
{ "delta", optional_argument, NULL, OPT_DELTA },
- { "subblock", optional_argument, NULL, OPT_SUBBLOCK },
// Other options
{ "quiet", no_argument, NULL, 'q' },
@@ -234,11 +232,6 @@ parse_real(args_info *args, int argc, char **argv)
// Filter setup
- case OPT_SUBBLOCK:
- coder_add_filter(LZMA_FILTER_SUBBLOCK,
- options_subblock(optarg));
- break;
-
case OPT_X86:
coder_add_filter(LZMA_FILTER_X86,
options_bcj(optarg));
@@ -413,7 +406,8 @@ parse_environment(args_info *args, char *argv0)
// Keep argc small enough to fit into a singed int
// and to keep it usable for memory allocation.
- if (++argc == MIN(INT_MAX, SIZE_MAX / sizeof(char *)))
+ if (++argc == my_min(
+ INT_MAX, SIZE_MAX / sizeof(char *)))
message_fatal(_("The environment variable "
"XZ_OPT contains too many "
"arguments"));
diff --git a/Build/source/extra/xz/src/xz/list.c b/Build/source/extra/xz/src/xz/list.c
index 91707b918b4..dda7c9bd782 100644
--- a/Build/source/extra/xz/src/xz/list.c
+++ b/Build/source/extra/xz/src/xz/list.c
@@ -14,6 +14,72 @@
#include "tuklib_integer.h"
+/// Information about a .xz file
+typedef struct {
+ /// Combined Index of all Streams in the file
+ lzma_index *idx;
+
+ /// Total amount of Stream Padding
+ uint64_t stream_padding;
+
+ /// Highest memory usage so far
+ uint64_t memusage_max;
+
+ /// True if all Blocks so far have Compressed Size and
+ /// Uncompressed Size fields
+ bool all_have_sizes;
+
+} xz_file_info;
+
+#define XZ_FILE_INFO_INIT { NULL, 0, 0, true }
+
+
+/// Information about a .xz Block
+typedef struct {
+ /// Size of the Block Header
+ uint32_t header_size;
+
+ /// A few of the Block Flags as a string
+ char flags[3];
+
+ /// Size of the Compressed Data field in the Block
+ lzma_vli compressed_size;
+
+ /// Decoder memory usage for this Block
+ uint64_t memusage;
+
+ /// The filter chain of this Block in human-readable form
+ const char *filter_chain;
+
+} block_header_info;
+
+
+/// Check ID to string mapping
+static const char check_names[LZMA_CHECK_ID_MAX + 1][12] = {
+ "None",
+ "CRC32",
+ "Unknown-2",
+ "Unknown-3",
+ "CRC64",
+ "Unknown-5",
+ "Unknown-6",
+ "Unknown-7",
+ "Unknown-8",
+ "Unknown-9",
+ "SHA-256",
+ "Unknown-11",
+ "Unknown-12",
+ "Unknown-13",
+ "Unknown-14",
+ "Unknown-15",
+};
+
+
+/// Value of the Check field as hexadecimal string.
+/// This is set by parse_check_value().
+static char check_value[2 * LZMA_CHECK_SIZE_MAX + 1];
+
+
/// Totals that are displayed if there was more than one file.
/// The "files" counter is also used in print_info_adv() to show
/// the file number.
@@ -23,15 +89,17 @@ static struct {
uint64_t blocks;
uint64_t compressed_size;
uint64_t uncompressed_size;
+ uint64_t stream_padding;
+ uint64_t memusage_max;
uint32_t checks;
-} totals = { 0, 0, 0, 0, 0, 0 };
+ bool all_have_sizes;
+} totals = { 0, 0, 0, 0, 0, 0, 0, 0, true };
/// \brief Parse the Index(es) from the given .xz file
///
-/// \param idx If decoding is successful, *idx will be set to point
-/// to lzma_index containing the decoded information.
-/// On error, *idx is not modified.
+/// \param xfi Pointer to structure where the decoded information
+/// is stored.
/// \param pair Input file
///
/// \return On success, false is returned. On error, true is returned.
@@ -40,7 +108,7 @@ static struct {
// takes a callback function to parse the Index(es) from a .xz file to make
// it easy for applications.
static bool
-parse_indexes(lzma_index **idx, file_pair *pair)
+parse_indexes(xz_file_info *xfi, file_pair *pair)
{
if (pair->src_st.st_size <= 0) {
message_error(_("%s: File is empty"), pair->src_name);
@@ -156,7 +224,7 @@ parse_indexes(lzma_index **idx, file_pair *pair)
do {
// Don't give the decoder more input than the
// Index size.
- strm.avail_in = MIN(IO_BUFFER_SIZE, index_size);
+ strm.avail_in = my_min(IO_BUFFER_SIZE, index_size);
if (io_pread(pair, &buf, strm.avail_in, pos))
goto error;
@@ -257,12 +325,14 @@ parse_indexes(lzma_index **idx, file_pair *pair)
combined_index = this_index;
this_index = NULL;
+ xfi->stream_padding += stream_padding;
+
} while (pos > 0);
lzma_end(&strm);
// All OK. Make combined_index available to the caller.
- *idx = combined_index;
+ xfi->idx = combined_index;
return false;
error:
@@ -274,6 +344,193 @@ error:
}
+/// \brief Parse the Block Header
+///
+/// The result is stored into *bhi. The caller takes care of initializing it.
+///
+/// \return False on success, true on error.
+static bool
+parse_block_header(file_pair *pair, const lzma_index_iter *iter,
+ block_header_info *bhi, xz_file_info *xfi)
+{
+#if IO_BUFFER_SIZE < LZMA_BLOCK_HEADER_SIZE_MAX
+# error IO_BUFFER_SIZE < LZMA_BLOCK_HEADER_SIZE_MAX
+#endif
+
+ // Get the whole Block Header with one read, but don't read past
+ // the end of the Block (or even its Check field).
+ const uint32_t size = my_min(iter->block.total_size
+ - lzma_check_size(iter->stream.flags->check),
+ LZMA_BLOCK_HEADER_SIZE_MAX);
+ io_buf buf;
+ if (io_pread(pair, &buf, size, iter->block.compressed_file_offset))
+ return true;
+
+ // Zero would mean Index Indicator and thus not a valid Block.
+ if (buf.u8[0] == 0)
+ goto data_error;
+
+ lzma_block block;
+ lzma_filter filters[LZMA_FILTERS_MAX + 1];
+
+ // Initialize the pointers so that they can be passed to free().
+ for (size_t i = 0; i < ARRAY_SIZE(filters); ++i)
+ filters[i].options = NULL;
+
+ // Initialize the block structure and decode Block Header Size.
+ block.version = 0;
+ block.check = iter->stream.flags->check;
+ block.filters = filters;
+
+ block.header_size = lzma_block_header_size_decode(buf.u8[0]);
+ if (block.header_size > size)
+ goto data_error;
+
+ // Decode the Block Header.
+ switch (lzma_block_header_decode(&block, NULL, buf.u8)) {
+ case LZMA_OK:
+ break;
+
+ case LZMA_OPTIONS_ERROR:
+ message_error("%s: %s", pair->src_name,
+ message_strm(LZMA_OPTIONS_ERROR));
+ return true;
+
+ case LZMA_DATA_ERROR:
+ goto data_error;
+
+ default:
+ message_bug();
+ }
+
+ // Check the Block Flags. These must be done before calling
+ // lzma_block_compressed_size(), because it overwrites
+ // block.compressed_size.
+ bhi->flags[0] = block.compressed_size != LZMA_VLI_UNKNOWN
+ ? 'c' : '-';
+ bhi->flags[1] = block.uncompressed_size != LZMA_VLI_UNKNOWN
+ ? 'u' : '-';
+ bhi->flags[2] = '\0';
+
+ // Collect information if all Blocks have both Compressed Size
+ // and Uncompressed Size fields. They can be useful e.g. for
+ // multi-threaded decompression so it can be useful to know it.
+ xfi->all_have_sizes &= block.compressed_size != LZMA_VLI_UNKNOWN
+ && block.uncompressed_size != LZMA_VLI_UNKNOWN;
+
+ // Validate or set block.compressed_size.
+ switch (lzma_block_compressed_size(&block,
+ iter->block.unpadded_size)) {
+ case LZMA_OK:
+ break;
+
+ case LZMA_DATA_ERROR:
+ goto data_error;
+
+ default:
+ message_bug();
+ }
+
+ // Copy the known sizes.
+ bhi->header_size = block.header_size;
+ bhi->compressed_size = block.compressed_size;
+
+ // Calculate the decoder memory usage and update the maximum
+ // memory usage of this Block.
+ bhi->memusage = lzma_raw_decoder_memusage(filters);
+ if (xfi->memusage_max < bhi->memusage)
+ xfi->memusage_max = bhi->memusage;
+
+ // Convert the filter chain to human readable form.
+ bhi->filter_chain = message_filters_to_str(filters, false);
+
+ // Free the memory allocated by lzma_block_header_decode().
+ for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i)
+ free(filters[i].options);
+
+ return false;
+
+data_error:
+ // Show the error message.
+ message_error("%s: %s", pair->src_name,
+ message_strm(LZMA_DATA_ERROR));
+
+ // Free the memory allocated by lzma_block_header_decode().
+ // This is truly needed only if we get here after a succcessful
+ // call to lzma_block_header_decode() but it doesn't hurt to
+ // always do it.
+ for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i)
+ free(filters[i].options);
+
+ return true;
+}
+
+
+/// \brief Parse the Check field and put it into check_value[]
+///
+/// \return False on success, true on error.
+static bool
+parse_check_value(file_pair *pair, const lzma_index_iter *iter)
+{
+ // Don't read anything from the file if there is no integrity Check.
+ if (iter->stream.flags->check == LZMA_CHECK_NONE) {
+ snprintf(check_value, sizeof(check_value), "---");
+ return false;
+ }
+
+ // Locate and read the Check field.
+ const uint32_t size = lzma_check_size(iter->stream.flags->check);
+ const off_t offset = iter->block.compressed_file_offset
+ + iter->block.total_size - size;
+ io_buf buf;
+ if (io_pread(pair, &buf, size, offset))
+ return true;
+
+ // CRC32 and CRC64 are in little endian. Guess that all the future
+ // 32-bit and 64-bit Check values are little endian too. It shouldn't
+ // be a too big problem if this guess is wrong.
+ if (size == 4)
+ snprintf(check_value, sizeof(check_value),
+ "%08" PRIx32, conv32le(buf.u32[0]));
+ else if (size == 8)
+ snprintf(check_value, sizeof(check_value),
+ "%016" PRIx64, conv64le(buf.u64[0]));
+ else
+ for (size_t i = 0; i < size; ++i)
+ snprintf(check_value + i * 2, 3, "%02x", buf.u8[i]);
+
+ return false;
+}
+
+
+/// \brief Parse detailed information about a Block
+///
+/// Since this requires seek(s), listing information about all Blocks can
+/// be slow.
+///
+/// \param pair Input file
+/// \param iter Location of the Block whose Check value should
+/// be printed.
+/// \param bhi Pointer to structure where to store the information
+/// about the Block Header field.
+///
+/// \return False on success, true on error. If an error occurs,
+/// the error message is printed too so the caller doesn't
+/// need to worry about that.
+static bool
+parse_details(file_pair *pair, const lzma_index_iter *iter,
+ block_header_info *bhi, xz_file_info *xfi)
+{
+ if (parse_block_header(pair, iter, bhi, xfi))
+ return true;
+
+ if (parse_check_value(pair, iter))
+ return true;
+
+ return false;
+}
+
+
/// \brief Get the compression ratio
///
/// This has slightly different format than that is used by in message.c.
@@ -294,26 +551,6 @@ get_ratio(uint64_t compressed_size, uint64_t uncompressed_size)
}
-static const char check_names[LZMA_CHECK_ID_MAX + 1][12] = {
- "None",
- "CRC32",
- "Unknown-2",
- "Unknown-3",
- "CRC64",
- "Unknown-5",
- "Unknown-6",
- "Unknown-7",
- "Unknown-8",
- "Unknown-9",
- "SHA-256",
- "Unknown-11",
- "Unknown-12",
- "Unknown-13",
- "Unknown-14",
- "Unknown-15",
-};
-
-
/// \brief Get a comma-separated list of Check names
///
/// \param checks Bit mask of Checks to print
@@ -345,51 +582,8 @@ get_check_names(uint32_t checks, bool space_after_comma)
}
-/// \brief Read the Check value from the .xz file and print it
-///
-/// Since this requires a seek, listing all Check values for all Blocks can
-/// be slow.
-///
-/// \param pair Input file
-/// \param iter Location of the Block whose Check value should
-/// be printed.
-///
-/// \return False on success, true on I/O error.
static bool
-print_check_value(file_pair *pair, const lzma_index_iter *iter)
-{
- // Don't read anything from the file if there is no integrity Check.
- if (iter->stream.flags->check == LZMA_CHECK_NONE) {
- printf("---");
- return false;
- }
-
- // Locate and read the Check field.
- const uint32_t size = lzma_check_size(iter->stream.flags->check);
- const off_t offset = iter->block.compressed_file_offset
- + iter->block.total_size - size;
- io_buf buf;
- if (io_pread(pair, &buf, size, offset))
- return true;
-
- // CRC32 and CRC64 are in little endian. Guess that all the future
- // 32-bit and 64-bit Check values are little endian too. It shouldn't
- // be a too big problem if this guess is wrong.
- if (size == 4) {
- printf("%08" PRIx32, conv32le(buf.u32[0]));
- } else if (size == 8) {
- printf("%016" PRIx64, conv64le(buf.u64[0]));
- } else {
- for (size_t i = 0; i < size; ++i)
- printf("%02x", buf.u8[i]);
- }
-
- return false;
-}
-
-
-static void
-print_info_basic(const lzma_index *idx, file_pair *pair)
+print_info_basic(const xz_file_info *xfi, file_pair *pair)
{
static bool headings_displayed = false;
if (!headings_displayed) {
@@ -403,29 +597,30 @@ print_info_basic(const lzma_index *idx, file_pair *pair)
}
printf("%5s %7s %11s %11s %5s %-7s %s\n",
- uint64_to_str(lzma_index_stream_count(idx), 0),
- uint64_to_str(lzma_index_block_count(idx), 1),
- uint64_to_nicestr(lzma_index_file_size(idx),
+ uint64_to_str(lzma_index_stream_count(xfi->idx), 0),
+ uint64_to_str(lzma_index_block_count(xfi->idx), 1),
+ uint64_to_nicestr(lzma_index_file_size(xfi->idx),
NICESTR_B, NICESTR_TIB, false, 2),
- uint64_to_nicestr(lzma_index_uncompressed_size(idx),
+ uint64_to_nicestr(
+ lzma_index_uncompressed_size(xfi->idx),
NICESTR_B, NICESTR_TIB, false, 3),
- get_ratio(lzma_index_file_size(idx),
- lzma_index_uncompressed_size(idx)),
- get_check_names(lzma_index_checks(idx), false),
+ get_ratio(lzma_index_file_size(xfi->idx),
+ lzma_index_uncompressed_size(xfi->idx)),
+ get_check_names(lzma_index_checks(xfi->idx), false),
pair->src_name);
- return;
+ return false;
}
static void
print_adv_helper(uint64_t stream_count, uint64_t block_count,
uint64_t compressed_size, uint64_t uncompressed_size,
- uint32_t checks)
+ uint32_t checks, uint64_t stream_padding)
{
- printf(_(" Stream count: %s\n"),
+ printf(_(" Streams: %s\n"),
uint64_to_str(stream_count, 0));
- printf(_(" Block count: %s\n"),
+ printf(_(" Blocks: %s\n"),
uint64_to_str(block_count, 0));
printf(_(" Compressed size: %s\n"),
uint64_to_nicestr(compressed_size,
@@ -437,127 +632,187 @@ print_adv_helper(uint64_t stream_count, uint64_t block_count,
get_ratio(compressed_size, uncompressed_size));
printf(_(" Check: %s\n"),
get_check_names(checks, true));
+ printf(_(" Stream padding: %s\n"),
+ uint64_to_nicestr(stream_padding,
+ NICESTR_B, NICESTR_TIB, true, 0));
return;
}
-static void
-print_info_adv(const lzma_index *idx, file_pair *pair)
+static bool
+print_info_adv(xz_file_info *xfi, file_pair *pair)
{
// Print the overall information.
- print_adv_helper(lzma_index_stream_count(idx),
- lzma_index_block_count(idx),
- lzma_index_file_size(idx),
- lzma_index_uncompressed_size(idx),
- lzma_index_checks(idx));
-
- // TODO: The rest of this function needs some work. Currently
- // the offsets are not printed, which could be useful even when
- // printed in a less accurate format. On the other hand, maybe
- // this should print the information with exact byte values,
- // or maybe there should be at least an option to do that.
- //
- // We could also display some other info. E.g. it could be useful
- // to quickly see how big is the biggest Block (uncompressed size)
- // and if all Blocks have Compressed Size and Uncompressed Size
- // fields present, which can be used e.g. for multithreaded
- // decompression.
-
- // Avoid printing Stream and Block lists when they wouldn't be useful.
- bool show_blocks = false;
- if (lzma_index_stream_count(idx) > 1) {
- puts(_(" Streams:"));
- puts(_(" Number Blocks Compressed "
- "Uncompressed Ratio Check"));
-
- lzma_index_iter iter;
- lzma_index_iter_init(&iter, idx);
- while (!lzma_index_iter_next(&iter, LZMA_INDEX_ITER_STREAM)) {
- if (iter.stream.block_count > 1)
- show_blocks = true;
-
- printf(" %8s %10s %11s %11s %5s %s\n",
+ print_adv_helper(lzma_index_stream_count(xfi->idx),
+ lzma_index_block_count(xfi->idx),
+ lzma_index_file_size(xfi->idx),
+ lzma_index_uncompressed_size(xfi->idx),
+ lzma_index_checks(xfi->idx),
+ xfi->stream_padding);
+
+ // Size of the biggest Check. This is used to calculate the width
+ // of the CheckVal field. The table would get insanely wide if
+ // we always reserved space for 64-byte Check (128 chars as hex).
+ uint32_t check_max = 0;
+
+ // Print information about the Streams.
+ puts(_(" Streams:\n Stream Blocks"
+ " CompOffset UncompOffset"
+ " CompSize UncompSize Ratio"
+ " Check Padding"));
+
+ lzma_index_iter iter;
+ lzma_index_iter_init(&iter, xfi->idx);
+
+ while (!lzma_index_iter_next(&iter, LZMA_INDEX_ITER_STREAM)) {
+ printf(" %6s %9s %15s %15s ",
uint64_to_str(iter.stream.number, 0),
uint64_to_str(iter.stream.block_count, 1),
- uint64_to_nicestr(
- iter.stream.compressed_size,
- NICESTR_B, NICESTR_TIB, false, 2),
- uint64_to_nicestr(
- iter.stream.uncompressed_size,
- NICESTR_B, NICESTR_TIB, false, 3),
+ uint64_to_str(
+ iter.stream.compressed_offset, 2),
+ uint64_to_str(
+ iter.stream.uncompressed_offset, 3));
+ printf("%15s %15s %5s %-10s %7s\n",
+ uint64_to_str(iter.stream.compressed_size, 0),
+ uint64_to_str(
+ iter.stream.uncompressed_size, 1),
get_ratio(iter.stream.compressed_size,
iter.stream.uncompressed_size),
- check_names[iter.stream.flags->check]);
- }
+ check_names[iter.stream.flags->check],
+ uint64_to_str(iter.stream.padding, 2));
+
+ // Update the maximum Check size.
+ if (lzma_check_size(iter.stream.flags->check) > check_max)
+ check_max = lzma_check_size(iter.stream.flags->check);
}
- if (show_blocks || lzma_index_block_count(idx)
- > lzma_index_stream_count(idx)
- || message_verbosity_get() >= V_DEBUG) {
- puts(_(" Blocks:"));
- // FIXME: Number in Stream/file, which one is better?
- puts(_(" Stream Number Compressed "
- "Uncompressed Ratio Check"));
+ // Cache the verbosity level to a local variable.
+ const bool detailed = message_verbosity_get() >= V_DEBUG;
- lzma_index_iter iter;
- lzma_index_iter_init(&iter, idx);
+ // Information collected from Block Headers
+ block_header_info bhi;
+
+ // Print information about the Blocks but only if there is
+ // at least one Block.
+ if (lzma_index_block_count(xfi->idx) > 0) {
+ // Calculate the width of the CheckVal field.
+ const int checkval_width = my_max(8, 2 * check_max);
+
+ // Print the headings.
+ printf(_(" Blocks:\n Stream Block"
+ " CompOffset UncompOffset"
+ " TotalSize UncompSize Ratio Check"));
+
+ if (detailed)
+ printf(_(" %-*s Header Flags CompSize"
+ " MemUsage Filters"),
+ checkval_width, _("CheckVal"));
+
+ putchar('\n');
+
+ lzma_index_iter_init(&iter, xfi->idx);
+
+ // Iterate over the Blocks.
while (!lzma_index_iter_next(&iter, LZMA_INDEX_ITER_BLOCK)) {
- printf(" %8s %10s %11s %11s %5s %-7s",
+ if (detailed && parse_details(pair, &iter, &bhi, xfi))
+ return true;
+
+ printf(" %6s %9s %15s %15s ",
uint64_to_str(iter.stream.number, 0),
- uint64_to_str(iter.block.number_in_stream, 1),
- uint64_to_nicestr(iter.block.total_size,
- NICESTR_B, NICESTR_TIB, false, 2),
- uint64_to_nicestr(
- iter.block.uncompressed_size,
- NICESTR_B, NICESTR_TIB, false, 3),
+ uint64_to_str(
+ iter.block.number_in_stream, 1),
+ uint64_to_str(
+ iter.block.compressed_file_offset, 2),
+ uint64_to_str(
+ iter.block.uncompressed_file_offset,
+ 3));
+ printf("%15s %15s %5s %-*s",
+ uint64_to_str(iter.block.total_size, 0),
+ uint64_to_str(iter.block.uncompressed_size,
+ 1),
get_ratio(iter.block.total_size,
iter.block.uncompressed_size),
+ detailed ? 11 : 1,
check_names[iter.stream.flags->check]);
- if (message_verbosity_get() >= V_DEBUG)
- if (print_check_value(pair, &iter))
- return;
+ if (detailed) {
+ // Show MiB for memory usage, because it
+ // is the only size which is not in bytes.
+ const lzma_vli compressed_size
+ = iter.block.unpadded_size
+ - bhi.header_size
+ - lzma_check_size(
+ iter.stream.flags->check);
+ printf("%-*s %6s %-5s %15s %7s MiB %s",
+ checkval_width, check_value,
+ uint64_to_str(bhi.header_size, 0),
+ bhi.flags,
+ uint64_to_str(compressed_size, 1),
+ uint64_to_str(
+ round_up_to_mib(bhi.memusage),
+ 2),
+ bhi.filter_chain);
+ }
putchar('\n');
}
}
+
+ if (detailed) {
+ printf(_(" Memory needed: %s MiB\n"), uint64_to_str(
+ round_up_to_mib(xfi->memusage_max), 0));
+ printf(_(" Sizes in headers: %s\n"),
+ xfi->all_have_sizes ? _("Yes") : _("No"));
+ }
+
+ return false;
}
-static void
-print_info_robot(const lzma_index *idx, file_pair *pair)
+static bool
+print_info_robot(xz_file_info *xfi, file_pair *pair)
{
+ printf("name\t%s\n", pair->src_name);
+
printf("file\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64
- "\t%s\t%s\t%s\n",
- lzma_index_stream_count(idx),
- lzma_index_block_count(idx),
- lzma_index_file_size(idx),
- lzma_index_uncompressed_size(idx),
- get_ratio(lzma_index_file_size(idx),
- lzma_index_uncompressed_size(idx)),
- get_check_names(lzma_index_checks(idx), false),
- pair->src_name);
+ "\t%s\t%s\t%" PRIu64 "\n",
+ lzma_index_stream_count(xfi->idx),
+ lzma_index_block_count(xfi->idx),
+ lzma_index_file_size(xfi->idx),
+ lzma_index_uncompressed_size(xfi->idx),
+ get_ratio(lzma_index_file_size(xfi->idx),
+ lzma_index_uncompressed_size(xfi->idx)),
+ get_check_names(lzma_index_checks(xfi->idx), false),
+ xfi->stream_padding);
if (message_verbosity_get() >= V_VERBOSE) {
lzma_index_iter iter;
- lzma_index_iter_init(&iter, idx);
+ lzma_index_iter_init(&iter, xfi->idx);
while (!lzma_index_iter_next(&iter, LZMA_INDEX_ITER_STREAM))
printf("stream\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64
- "\t%" PRIu64 "\t%" PRIu64
- "\t%s\t%" PRIu64 "\t%s\n",
+ "\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64
+ "\t%s\t%s\t%" PRIu64 "\n",
iter.stream.number,
+ iter.stream.block_count,
iter.stream.compressed_offset,
iter.stream.uncompressed_offset,
iter.stream.compressed_size,
iter.stream.uncompressed_size,
get_ratio(iter.stream.compressed_size,
iter.stream.uncompressed_size),
- iter.stream.padding,
- check_names[iter.stream.flags->check]);
+ check_names[iter.stream.flags->check],
+ iter.stream.padding);
lzma_index_iter_rewind(&iter);
+ block_header_info bhi;
+
while (!lzma_index_iter_next(&iter, LZMA_INDEX_ITER_BLOCK)) {
+ if (message_verbosity_get() >= V_DEBUG
+ && parse_details(
+ pair, &iter, &bhi, xfi))
+ return true;
+
printf("block\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64
"\t%" PRIu64 "\t%" PRIu64
"\t%" PRIu64 "\t%" PRIu64 "\t%s\t%s",
@@ -572,30 +827,46 @@ print_info_robot(const lzma_index *idx, file_pair *pair)
iter.block.uncompressed_size),
check_names[iter.stream.flags->check]);
- if (message_verbosity_get() >= V_DEBUG) {
- putchar('\t');
- if (print_check_value(pair, &iter))
- return;
- }
+ if (message_verbosity_get() >= V_DEBUG)
+ printf("\t%s\t%" PRIu32 "\t%s\t%" PRIu64
+ "\t%" PRIu64 "\t%s",
+ check_value,
+ bhi.header_size,
+ bhi.flags,
+ bhi.compressed_size,
+ bhi.memusage,
+ bhi.filter_chain);
putchar('\n');
}
}
- return;
+ if (message_verbosity_get() >= V_DEBUG)
+ printf("summary\t%" PRIu64 "\t%s\n",
+ xfi->memusage_max,
+ xfi->all_have_sizes ? "yes" : "no");
+
+ return false;
}
static void
-update_totals(const lzma_index *idx)
+update_totals(const xz_file_info *xfi)
{
// TODO: Integer overflow checks
++totals.files;
- totals.streams += lzma_index_stream_count(idx);
- totals.blocks += lzma_index_block_count(idx);
- totals.compressed_size += lzma_index_file_size(idx);
- totals.uncompressed_size += lzma_index_uncompressed_size(idx);
- totals.checks |= lzma_index_checks(idx);
+ totals.streams += lzma_index_stream_count(xfi->idx);
+ totals.blocks += lzma_index_block_count(xfi->idx);
+ totals.compressed_size += lzma_index_file_size(xfi->idx);
+ totals.uncompressed_size += lzma_index_uncompressed_size(xfi->idx);
+ totals.stream_padding += xfi->stream_padding;
+ totals.checks |= lzma_index_checks(xfi->idx);
+
+ if (totals.memusage_max < xfi->memusage_max)
+ totals.memusage_max = xfi->memusage_max;
+
+ totals.all_have_sizes &= xfi->all_have_sizes;
+
return;
}
@@ -647,7 +918,14 @@ print_totals_adv(void)
uint64_to_str(totals.files, 0));
print_adv_helper(totals.streams, totals.blocks,
totals.compressed_size, totals.uncompressed_size,
- totals.checks);
+ totals.checks, totals.stream_padding);
+
+ if (message_verbosity_get() >= V_DEBUG) {
+ printf(_(" Memory needed: %s MiB\n"), uint64_to_str(
+ round_up_to_mib(totals.memusage_max), 0));
+ printf(_(" Sizes in headers: %s\n"),
+ totals.all_have_sizes ? _("Yes") : _("No"));
+ }
return;
}
@@ -657,7 +935,7 @@ static void
print_totals_robot(void)
{
printf("totals\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64 "\t%" PRIu64
- "\t%s\t%s\t%" PRIu64 "\n",
+ "\t%s\t%s\t%" PRIu64 "\t%" PRIu64,
totals.streams,
totals.blocks,
totals.compressed_size,
@@ -665,8 +943,16 @@ print_totals_robot(void)
get_ratio(totals.compressed_size,
totals.uncompressed_size),
get_check_names(totals.checks, false),
+ totals.stream_padding,
totals.files);
+ if (message_verbosity_get() >= V_DEBUG)
+ printf("\t%" PRIu64 "\t%s",
+ totals.memusage_max,
+ totals.all_have_sizes ? "yes" : "no");
+
+ putchar('\n');
+
return;
}
@@ -716,11 +1002,9 @@ list_file(const char *filename)
if (pair == NULL)
return;
- lzma_index *idx;
- if (!parse_indexes(&idx, pair)) {
- // Update the totals that are displayed after all
- // the individual files have been listed.
- update_totals(idx);
+ xz_file_info xfi = XZ_FILE_INFO_INIT;
+ if (!parse_indexes(&xfi, pair)) {
+ bool fail;
// We have three main modes:
// - --robot, which has submodes if --verbose is specified
@@ -728,13 +1012,19 @@ list_file(const char *filename)
// - Normal --list without --verbose
// - --list with one or two --verbose
if (opt_robot)
- print_info_robot(idx, pair);
+ fail = print_info_robot(&xfi, pair);
else if (message_verbosity_get() <= V_WARNING)
- print_info_basic(idx, pair);
+ fail = print_info_basic(&xfi, pair);
else
- print_info_adv(idx, pair);
+ fail = print_info_adv(&xfi, pair);
+
+ // Update the totals that are displayed after all
+ // the individual files have been listed. Don't count
+ // broken files.
+ if (!fail)
+ update_totals(&xfi);
- lzma_index_end(idx, NULL);
+ lzma_index_end(xfi.idx, NULL);
}
io_close(pair, false);
diff --git a/Build/source/extra/xz/src/xz/main.c b/Build/source/extra/xz/src/xz/main.c
index e0905893c89..8196c6e7e77 100644
--- a/Build/source/extra/xz/src/xz/main.c
+++ b/Build/source/extra/xz/src/xz/main.c
@@ -13,10 +13,15 @@
#include "private.h"
#include <ctype.h>
-
/// Exit status to use. This can be changed with set_exit_status().
static enum exit_status_type exit_status = E_SUCCESS;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+/// exit_status has to be protected with a critical section due to
+/// how "signal handling" is done on Windows. See signals.c for details.
+static CRITICAL_SECTION exit_status_cs;
+#endif
+
/// True if --no-warn is specified. When this is true, we don't set
/// the exit status to E_WARNING when something worth a warning happens.
static bool no_warn = false;
@@ -27,9 +32,17 @@ set_exit_status(enum exit_status_type new_status)
{
assert(new_status == E_WARNING || new_status == E_ERROR);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ EnterCriticalSection(&exit_status_cs);
+#endif
+
if (exit_status != E_ERROR)
exit_status = new_status;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ LeaveCriticalSection(&exit_status_cs);
+#endif
+
return;
}
@@ -129,6 +142,10 @@ read_name(const args_info *args)
int
main(int argc, char **argv)
{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ InitializeCriticalSection(&exit_status_cs);
+#endif
+
// Set up the progname variable.
tuklib_progname_init(argv);
@@ -262,11 +279,24 @@ main(int argc, char **argv)
// of calling tuklib_exit().
signals_exit();
+ // Make a local copy of exit_status to keep the Windows code
+ // thread safe. At this point it is fine if we miss the user
+ // pressing C-c and don't set the exit_status to E_ERROR on
+ // Windows.
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ EnterCriticalSection(&exit_status_cs);
+#endif
+
+ enum exit_status_type es = exit_status;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ LeaveCriticalSection(&exit_status_cs);
+#endif
+
// Suppress the exit status indicating a warning if --no-warn
// was specified.
- if (exit_status == E_WARNING && no_warn)
- exit_status = E_SUCCESS;
+ if (es == E_WARNING && no_warn)
+ es = E_SUCCESS;
- tuklib_exit(exit_status, E_ERROR,
- message_verbosity_get() != V_SILENT);
+ tuklib_exit(es, E_ERROR, message_verbosity_get() != V_SILENT);
}
diff --git a/Build/source/extra/xz/src/xz/message.c b/Build/source/extra/xz/src/xz/message.c
index 94140132bf2..6eed5f7e690 100644
--- a/Build/source/extra/xz/src/xz/message.c
+++ b/Build/source/extra/xz/src/xz/message.c
@@ -142,19 +142,19 @@ message_init(void)
*/
#ifdef SIGALRM
- // At least DJGPP lacks SA_RESTART. It's not essential for us (the
- // rest of the code can handle interrupted system calls), so just
- // define it zero.
-# ifndef SA_RESTART
+ // DJGPP lacks SA_RESTART, but it shouldn't give EINTR
+ // in most places either.
+# if defined(__DJGPP__) && !defined(SA_RESTART)
# define SA_RESTART 0
# endif
+
// Establish the signal handlers which set a flag to tell us that
// progress info should be updated. Since these signals don't
- // require any quick action, we set SA_RESTART.
+ // require any quick action, we set SA_RESTART. That way we don't
+ // need to block them either in signals_block() to keep stdio
+ // functions from getting EINTR.
static const int sigs[] = {
-#ifdef SIGALRM
SIGALRM,
-#endif
#ifdef SIGINFO
SIGINFO,
#endif
@@ -896,7 +896,7 @@ uint32_to_optstr(uint32_t num)
extern const char *
-message_filters_get(const lzma_filter *filters, bool all_known)
+message_filters_to_str(const lzma_filter *filters, bool all_known)
{
static char buf[512];
@@ -912,8 +912,8 @@ message_filters_get(const lzma_filter *filters, bool all_known)
case LZMA_FILTER_LZMA1:
case LZMA_FILTER_LZMA2: {
const lzma_options_lzma *opt = filters[i].options;
- const char *mode;
- const char *mf;
+ const char *mode = NULL;
+ const char *mf = NULL;
if (all_known) {
switch (opt->mode) {
@@ -1036,7 +1036,7 @@ message_filters_show(enum message_verbosity v, const lzma_filter *filters)
return;
fprintf(stderr, _("%s: Filter chain: %s\n"), progname,
- message_filters_get(filters, true));
+ message_filters_to_str(filters, true));
return;
}
@@ -1181,15 +1181,6 @@ message_help(bool long_help)
" dist=NUM distance between bytes being subtracted\n"
" from each other (1-256; 1)"));
#endif
-
-#if defined(HAVE_ENCODER_SUBBLOCK) || defined(HAVE_DECODER_SUBBLOCK)
- puts(_(
-"\n"
-" --subblock[=OPTS] Subblock filter; valid OPTS (valid values; default):\n"
-" size=NUM number of bytes of data per subblock\n"
-" (1 - 256Mi; 4Ki)\n"
-" rle=NUM run-length encoder chunk size (0-256; 0)"));
-#endif
}
if (long_help)
diff --git a/Build/source/extra/xz/src/xz/message.h b/Build/source/extra/xz/src/xz/message.h
index 8f011874689..aea4fdfd667 100644
--- a/Build/source/extra/xz/src/xz/message.h
+++ b/Build/source/extra/xz/src/xz/message.h
@@ -94,7 +94,7 @@ extern void message_mem_needed(enum message_verbosity v, uint64_t memusage);
/// into .xz headers are printed.
///
/// \return Pointer to a statically allocated buffer.
-extern const char *message_filters_get(
+extern const char *message_filters_to_str(
const lzma_filter *filters, bool all_known);
diff --git a/Build/source/extra/xz/src/xz/options.c b/Build/source/extra/xz/src/xz/options.c
index 00b34a83ae1..7186f24c49d 100644
--- a/Build/source/extra/xz/src/xz/options.c
+++ b/Build/source/extra/xz/src/xz/options.c
@@ -139,67 +139,6 @@ parse_options(const char *str, const option_map *opts,
}
-//////////////
-// Subblock //
-//////////////
-
-enum {
- OPT_SIZE,
- OPT_RLE,
- OPT_ALIGN,
-};
-
-
-static void
-set_subblock(void *options, uint32_t key, uint64_t value,
- const char *valuestr lzma_attribute((unused)))
-{
- lzma_options_subblock *opt = options;
-
- switch (key) {
- case OPT_SIZE:
- opt->subblock_data_size = value;
- break;
-
- case OPT_RLE:
- opt->rle = value;
- break;
-
- case OPT_ALIGN:
- opt->alignment = value;
- break;
- }
-}
-
-
-extern lzma_options_subblock *
-options_subblock(const char *str)
-{
- static const option_map opts[] = {
- { "size", NULL, LZMA_SUBBLOCK_DATA_SIZE_MIN,
- LZMA_SUBBLOCK_DATA_SIZE_MAX },
- { "rle", NULL, LZMA_SUBBLOCK_RLE_OFF,
- LZMA_SUBBLOCK_RLE_MAX },
- { "align",NULL, LZMA_SUBBLOCK_ALIGNMENT_MIN,
- LZMA_SUBBLOCK_ALIGNMENT_MAX },
- { NULL, NULL, 0, 0 }
- };
-
- lzma_options_subblock *options
- = xmalloc(sizeof(lzma_options_subblock));
- *options = (lzma_options_subblock){
- .allow_subfilters = false,
- .alignment = LZMA_SUBBLOCK_ALIGNMENT_DEFAULT,
- .subblock_data_size = LZMA_SUBBLOCK_DATA_SIZE_DEFAULT,
- .rle = LZMA_SUBBLOCK_RLE_OFF,
- };
-
- parse_options(str, opts, &set_subblock, options);
-
- return options;
-}
-
-
///////////
// Delta //
///////////
diff --git a/Build/source/extra/xz/src/xz/options.h b/Build/source/extra/xz/src/xz/options.h
index e7389c8e99c..61ec8d58a14 100644
--- a/Build/source/extra/xz/src/xz/options.h
+++ b/Build/source/extra/xz/src/xz/options.h
@@ -10,13 +10,6 @@
//
///////////////////////////////////////////////////////////////////////////////
-/// \brief Parser for Subblock options
-///
-/// \return Pointer to allocated options structure.
-/// Doesn't return on error.
-extern lzma_options_subblock *options_subblock(const char *str);
-
-
/// \brief Parser for Delta options
///
/// \return Pointer to allocated options structure.
diff --git a/Build/source/extra/xz/src/xz/private.h b/Build/source/extra/xz/src/xz/private.h
index b543435750d..15136bfe878 100644
--- a/Build/source/extra/xz/src/xz/private.h
+++ b/Build/source/extra/xz/src/xz/private.h
@@ -26,6 +26,11 @@
#include "tuklib_progname.h"
#include "tuklib_exit.h"
+#if defined(_WIN32) && !defined(__CYGWIN__)
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
#ifndef STDIN_FILENO
# define STDIN_FILENO (fileno(stdin))
#endif
diff --git a/Build/source/extra/xz/src/xz/signals.c b/Build/source/extra/xz/src/xz/signals.c
index b27cd5b52cb..66d65373322 100644
--- a/Build/source/extra/xz/src/xz/signals.c
+++ b/Build/source/extra/xz/src/xz/signals.c
@@ -16,7 +16,7 @@
volatile sig_atomic_t user_abort = false;
-#ifndef _WIN32
+#if !(defined(_WIN32) && !defined(__CYGWIN__))
/// If we were interrupted by a signal, we store the signal number so that
/// we can raise that signal to kill the program when all cleanups have
@@ -156,11 +156,14 @@ signals_exit(void)
#else
// While Windows has some very basic signal handling functions as required
-// by C89, they are not really used, or so I understood. Instead, we use
-// SetConsoleCtrlHandler() to catch user pressing C-c.
-
-#include <windows.h>
-
+// by C89, they are not really used, and e.g. SIGINT doesn't work exactly
+// the way it does on POSIX (Windows creates a new thread for the signal
+// handler). Instead, we use SetConsoleCtrlHandler() to catch user
+// pressing C-c, because that seems to be the recommended way to do it.
+//
+// NOTE: This doesn't work under MSYS. Trying with SIGINT doesn't work
+// either even if it appeared to work at first. So test using Windows
+// console window.
static BOOL WINAPI
signal_handler(DWORD type lzma_attribute((unused)))
@@ -168,9 +171,6 @@ signal_handler(DWORD type lzma_attribute((unused)))
// Since we don't get a signal number which we could raise() at
// signals_exit() like on POSIX, just set the exit status to
// indicate an error, so that we cannot return with zero exit status.
- //
- // FIXME: Since this function runs in its own thread,
- // set_exit_status() should have a mutex.
set_exit_status(E_ERROR);
user_abort = true;
return TRUE;
diff --git a/Build/source/extra/xz/src/xz/signals.h b/Build/source/extra/xz/src/xz/signals.h
index 7603d8033f7..5b125e0f0d7 100644
--- a/Build/source/extra/xz/src/xz/signals.h
+++ b/Build/source/extra/xz/src/xz/signals.h
@@ -21,7 +21,7 @@ extern volatile sig_atomic_t user_abort;
extern void signals_init(void);
-#if defined(_WIN32) || defined(__VMS)
+#if (defined(_WIN32) && !defined(__CYGWIN__)) || defined(__VMS)
# define signals_block() do { } while (0)
# define signals_unblock() do { } while (0)
#else
@@ -34,7 +34,7 @@ extern void signals_block(void);
extern void signals_unblock(void);
#endif
-#ifdef _WIN32
+#if defined(_WIN32) && !defined(__CYGWIN__)
# define signals_exit() do { } while (0)
#else
/// If user has sent us a signal earlier to terminate the process,
diff --git a/Build/source/extra/xz/src/xz/xz.1 b/Build/source/extra/xz/src/xz/xz.1
index b60353d0e92..1f2fd9c27bf 100644
--- a/Build/source/extra/xz/src/xz/xz.1
+++ b/Build/source/extra/xz/src/xz/xz.1
@@ -5,7 +5,7 @@
.\" This file has been put into the public domain.
.\" You can do whatever you want with this file.
.\"
-.TH XZ 1 "2010-03-07" "Tukaani" "XZ Utils"
+.TH XZ 1 "2010-06-01" "Tukaani" "XZ Utils"
.SH NAME
xz, unxz, xzcat, lzma, unlzma, lzcat \- Compress or decompress .xz and .lzma files
.SH SYNOPSIS
@@ -232,6 +232,24 @@ or near the bottom of the output of
.BR \-\-long\-help .
The default limit can be overridden with
\fB\-\-memory=\fIlimit\fR.
+.SS Concatenation and padding with .xz files
+It is possible to concatenate
+.B .xz
+files as is.
+.B xz
+will decompress such files as if they were a single
+.B .xz
+file.
+.PP
+It is possible to insert padding between the concenated parts
+or after the last part. The padding must be null bytes and the size
+of the padding must be a multiple of four bytes. This can be useful
+if the .xz file is stored on a medium that stores file sizes
+e.g. as 512-byte blocks.
+.PP
+Concatenation and padding are not allowed with
+.B .lzma
+files or raw streams.
.SH OPTIONS
.SS "Integer suffixes and special values"
In most places where an integer argument is expected, an optional suffix
@@ -295,12 +313,29 @@ except that the decompressed data is discarded instead of being
written to standard output.
.TP
.BR \-l ", " \-\-list
-View information about the compressed files. No uncompressed output is
-produced, and no files are created or removed. In list mode, the program
-cannot read the compressed data from standard input or from other
-unseekable sources.
+List information about compressed
+.IR files .
+No uncompressed output is produced, and no files are created or removed.
+In list mode, the program cannot read the compressed data from standard
+input or from other unseekable sources.
.IP
-.B "This feature has not been implemented yet."
+The default listing shows basic information about
+.IR files ,
+one file per line. To get more detailed information, use also the
+.B \-\-verbose
+option. For even more information, use
+.B \-\-verbose
+twice, but note that it may be slow, because getting all the extra
+information requires many seeks. The width of verbose output exceeds
+80 characters, so piping the output to e.g.
+.B "less\ \-S"
+may be convenient if the terminal isn't wide enough.
+.IP
+The exact output may vary between
+.B xz
+versions and different locales. To get machine-readable output,
+.B \-\-robot \-\-list
+should be used.
.SS "Operation modifiers"
.TP
.BR \-k ", " \-\-keep
@@ -1085,14 +1120,9 @@ writing frontends that want to use
instead of liblzma, which may be the case with various scripts. The output
with this option enabled is meant to be stable across
.B xz
-releases. Currently
-.B \-\-robot
-is implemented only for
-.B \-\-info\-memory
-and
-.BR \-\-version ,
-but the idea is to make it usable for actual compression
-and decompression too.
+releases. See the section
+.B "ROBOT MODE"
+for details.
.TP
.BR \-\-info-memory
Display the current memory usage limit in human-readable format on
@@ -1100,11 +1130,6 @@ a single line, and exit successfully. To see how much RAM
.B xz
thinks your system has, use
.BR "\-\-memory=100% \-\-info\-memory" .
-To get machine-parsable output
-(memory usage limit as bytes without thousand separators), specify
-.B \-\-robot
-before
-.BR \-\-info-memory .
.TP
.BR \-h ", " \-\-help
Display a help message describing the most commonly used options,
@@ -1122,6 +1147,291 @@ and liblzma in human readable format. To get machine-parsable output, specify
.B \-\-robot
before
.BR \-\-version .
+.SH ROBOT MODE
+The robot mode is activated with the
+.B \-\-robot
+option. It makes the output of
+.B xz
+easier to parse by other programs. Currently
+.B \-\-robot
+is supported only together with
+.BR \-\-version ,
+.BR \-\-info-memory ,
+and
+.BR \-\-list .
+It will be supported for normal compression and decompression in the future.
+.PP
+.SS Version
+.B "xz \-\-robot \-\-version"
+will print the version number of
+.B xz
+and liblzma in the following format:
+.PP
+.BI XZ_VERSION= XYYYZZZS
+.br
+.BI LIBLZMA_VERSION= XYYYZZZS
+.TP
+.I X
+Major version.
+.TP
+.I YYY
+Minor version. Even numbers are stable.
+Odd numbers are alpha or beta versions.
+.TP
+.I ZZZ
+Patch level for stable releases or just a counter for development releases.
+.TP
+.I S
+Stability.
+.B 0
+is alpha,
+.B 1
+is beta, and
+.B 2
+is stable.
+.I S
+should be always
+.B 2
+when
+.I YYY
+is even.
+.PP
+.I XYYYZZZS
+are the same on both lines if
+.B xz
+and liblzma are from the same XZ Utils release.
+.PP
+Examples: 4.999.9beta is
+.B 49990091
+and
+5.0.0 is
+.BR 50000002 .
+.SS Memory limit information
+.B "xz \-\-robot \-\-info-memory"
+prints the current memory usage limit as bytes on a single line.
+To get the total amount of installed RAM, use
+.BR "xz \-\-robot \-\-memory=100% \-\-info-memory" .
+.SS List mode
+.B "xz \-\-robot \-\-list"
+uses tab-separated output. The first column of every line has a string
+that indicates the type of the information found on that line:
+.TP
+.B name
+This is always the first line when starting to list a file. The second
+column on the line is the filename.
+.TP
+.B file
+This line contains overall information about the
+.B .xz
+file. This line is always printed after the
+.B name
+line.
+.TP
+.B stream
+This line type is used only when
+.B \-\-verbose
+was specified. There are as many
+.B stream
+lines as there are streams in the
+.B .xz
+file.
+.TP
+.B block
+This line type is used only when
+.B \-\-verbose
+was specified. There are as many
+.B block
+lines as there are blocks in the
+.B .xz
+file. The
+.B block
+lines are shown after all the
+.B stream
+lines; different line types are not interleaved.
+.TP
+.B summary
+This line type is used only when
+.B \-\-verbose
+was specified twice. This line is printed after all
+.B block
+lines. Like the
+.B file
+line, the
+.B summary
+line contains overall information about the
+.B .xz
+file.
+.TP
+.B totals
+This line is always the very last line of the list output. It shows
+the total counts and sizes.
+.PP
+The columns of the
+.B file
+lines:
+.RS
+.IP 2. 4
+Number of streams in the file
+.IP 3. 4
+Total number of blocks in the stream(s)
+.IP 4. 4
+Compressed size of the file
+.IP 5. 4
+Uncompressed size of the file
+.IP 6. 4
+Compression ratio, for example
+.BR 0.123.
+If ratio is over 9.999, three dashes
+.RB ( \-\-\- )
+are displayed instead of the ratio.
+.IP 7. 4
+Comma-separated list of integrity check names. The following strings are
+used for the known check types:
+.BR None ,
+.BR CRC32 ,
+.BR CRC64 ,
+and
+.BR SHA\-256 .
+For unknown check types,
+.BI Unknown\- N
+is used, where
+.I N
+is the Check ID as a decimal number (one or two digits).
+.IP 8. 4
+Total size of stream padding in the file
+.RE
+.PP
+The columns of the
+.B stream
+lines:
+.RS
+.IP 2. 4
+Stream number (the first stream is 1)
+.IP 3. 4
+Number of blocks in the stream
+.IP 4. 4
+Compressed start offset
+.IP 5. 4
+Uncompressed start offset
+.IP 6. 4
+Compressed size (does not include stream padding)
+.IP 7. 4
+Uncompressed size
+.IP 8. 4
+Compression ratio
+.IP 9. 4
+Name of the integrity check
+.IP 10. 4
+Size of stream padding
+.RE
+.PP
+The columns of the
+.B block
+lines:
+.RS
+.IP 2. 4
+Number of the stream containing this block
+.IP 3. 4
+Block number relative to the beginning of the stream (the first block is 1)
+.IP 4. 4
+Block number relative to the beginning of the file
+.IP 5. 4
+Compressed start offset relative to the beginning of the file
+.IP 6. 4
+Uncompressed start offset relative to the beginning of the file
+.IP 7. 4
+Total compressed size of the block (includes headers)
+.IP 8. 4
+Uncompressed size
+.IP 9. 4
+Compression ratio
+.IP 10. 4
+Name of the integrity check
+.RE
+.PP
+If
+.B \-\-verbose
+was specified twice, additional columns are included on the
+.B block
+lines. These are not displayed with a single
+.BR \-\-verbose ,
+because getting this information requires many seeks and can thus be slow:
+.RS
+.IP 11. 4
+Value of the integrity check in hexadecimal
+.IP 12. 4
+Block header size
+.IP 13. 4
+Block flags:
+.B c
+indicates that compressed size is present, and
+.B u
+indicates that uncompressed size is present.
+If the flag is not set, a dash
+.RB ( \- )
+is shown instead to keep the string length fixed. New flags may be added
+to the end of the string in the future.
+.IP 14. 4
+Size of the actual compressed data in the block (this excludes
+the block header, block padding, and check fields)
+.IP 15. 4
+Amount of memory (as bytes) required to decompress this block with this
+.B xz
+version
+.IP 16. 4
+Filter chain. Note that most of the options used at compression time cannot
+be known, because only the options that are needed for decompression are
+stored in the
+.B .xz
+headers.
+.RE
+.PP
+The columns of the
+.B totals
+line:
+.RS
+.IP 2. 4
+Number of streams
+.IP 3. 4
+Number of blocks
+.IP 4. 4
+Compressed size
+.IP 5. 4
+Uncompressed size
+.IP 6. 4
+Average compression ratio
+.IP 7. 4
+Comma-separated list of integrity check names that were present in the files
+.IP 8. 4
+Stream padding size
+.IP 9. 4
+Number of files. This is here to keep the order of the earlier columns
+the same as on
+.B file
+lines.
+.RE
+.PP
+If
+.B \-\-verbose
+was specified twice, additional columns are included on the
+.B totals
+line:
+.RS
+.IP 10. 4
+Maximum amount of memory (as bytes) required to decompress the files
+with this
+.B xz
+version
+.IP 11. 4
+.B yes
+or
+.B no
+indicating if all block headers have both compressed size and
+uncompressed size stored in them
+.RE
+.PP
+Future versions may add new line types and new columns can be added to
+the existing line types, but the existing columns won't be changed.
.SH "EXIT STATUS"
.TP
.B 0
@@ -1339,6 +1649,43 @@ integrity check if the particular
is not supported.
.PP
XZ Embedded supports BCJ filters, but only with the default start offset.
+.SH EXAMPLES
+.SS Basics
+A mix of compressed and uncompressed files can be decompressed
+to standard output with a single command:
+.IP
+.B "xz -dcf a.txt b.txt.xz c.txt d.txt.xz > abcd.txt"
+.SS Parallel compression of many files
+On GNU and *BSD,
+.BR find (1)
+and
+.BR xargs (1)
+can be used to parallellize compression of many files:
+.PP
+.IP
+.B "find . \-type f \e! \-name '*.xz' \-print0 | xargs \-0r \-P4 \-n16 xz"
+.PP
+The
+.B \-P
+option sets the number of parallel
+.B xz
+processes. The best value for the
+.B \-n
+option depends on how many files there are to be compressed.
+If there are only a couple of files, the value should probably be
+.BR 1 ;
+with tens of thousands of files,
+.B 100
+or even more may be appropriate to reduce the number of
+.B xz
+processes that
+.BR xargs (1)
+will eventually create.
+.SS Robot mode examples
+Calculating how many bytes have been saved in total after compressing
+multiple files:
+.IP
+.B "xz --robot --list *.xz | awk '/^totals/{print $5\-$4}'"
.SH "SEE ALSO"
.BR xzdec (1),
.BR gzip (1),
diff --git a/Build/source/extra/xz/src/xzdec/Makefile.in b/Build/source/extra/xz/src/xzdec/Makefile.in
index 5c61984a9b9..058e92d1713 100644
--- a/Build/source/extra/xz/src/xzdec/Makefile.in
+++ b/Build/source/extra/xz/src/xzdec/Makefile.in
@@ -265,7 +265,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
-lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@