aboutsummaryrefslogtreecommitdiff
path: root/archival/libunarchive/unxz/xz_private.h
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-06-20 02:40:56 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-06-20 02:40:56 +0200
commitba73cfd28464f9ef926dfd27e264215d4c4f8b1f (patch)
tree1388876b477579cb6f43b4eb12b258b61bc8f010 /archival/libunarchive/unxz/xz_private.h
parent91d7ee31f766a13595c1042d375f8374f2c3675f (diff)
downloadbusybox-ba73cfd28464f9ef926dfd27e264215d4c4f8b1f.tar.gz
unxz: update from XZ embedded git
function old new delta rc_reset - 21 +21 unpack_xz_stream 2342 2357 +15 lzma_reset 102 64 -38 lzma_len 506 443 -63 xz_dec_lzma2_run 1438 1374 -64 xz_dec_reset 73 - -73 lzma_main 2517 2183 -334 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 1/4 up/down: 36/-572) Total: -536 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libunarchive/unxz/xz_private.h')
-rw-r--r--archival/libunarchive/unxz/xz_private.h41
1 files changed, 40 insertions, 1 deletions
diff --git a/archival/libunarchive/unxz/xz_private.h b/archival/libunarchive/unxz/xz_private.h
index f4e0b4010..145649a83 100644
--- a/archival/libunarchive/unxz/xz_private.h
+++ b/archival/libunarchive/unxz/xz_private.h
@@ -53,6 +53,45 @@
# include "xz_config.h"
#endif
+/* If no specific decoding mode is requested, enable support for all modes. */
+#if !defined(XZ_DEC_SINGLE) && !defined(XZ_DEC_PREALLOC) \
+ && !defined(XZ_DEC_DYNALLOC)
+# define XZ_DEC_SINGLE
+# define XZ_DEC_PREALLOC
+# define XZ_DEC_DYNALLOC
+#endif
+
+/*
+ * The DEC_IS_foo(mode) macros are used in "if" statements. If only some
+ * of the supported modes are enabled, these macros will evaluate to true or
+ * false at compile time and thus allow the compiler to omit unneeded code.
+ */
+#ifdef XZ_DEC_SINGLE
+# define DEC_IS_SINGLE(mode) ((mode) == XZ_SINGLE)
+#else
+# define DEC_IS_SINGLE(mode) (false)
+#endif
+
+#ifdef XZ_DEC_PREALLOC
+# define DEC_IS_PREALLOC(mode) ((mode) == XZ_PREALLOC)
+#else
+# define DEC_IS_PREALLOC(mode) (false)
+#endif
+
+#ifdef XZ_DEC_DYNALLOC
+# define DEC_IS_DYNALLOC(mode) ((mode) == XZ_DYNALLOC)
+#else
+# define DEC_IS_DYNALLOC(mode) (false)
+#endif
+
+#if !defined(XZ_DEC_SINGLE)
+# define DEC_IS_MULTI(mode) (true)
+#elif defined(XZ_DEC_PREALLOC) || defined(XZ_DEC_DYNALLOC)
+# define DEC_IS_MULTI(mode) ((mode) != XZ_SINGLE)
+#else
+# define DEC_IS_MULTI(mode) (false)
+#endif
+
/*
* If any of the BCJ filter decoders are wanted, define XZ_DEC_BCJ.
* XZ_DEC_BCJ is used to enable generic support for BCJ decoders.
@@ -71,7 +110,7 @@
* before calling xz_dec_lzma2_run().
*/
XZ_EXTERN struct xz_dec_lzma2 * XZ_FUNC xz_dec_lzma2_create(
- uint32_t dict_max);
+ enum xz_mode mode, uint32_t dict_max);
/*
* Decode the LZMA2 properties (one byte) and reset the decoder. Return