From 602ce69afb7c825a5aeed16d0bdb5a6a213d1cb1 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 30 May 2010 03:35:18 +0200 Subject: unxz: new applet, complete with xzcat and xz -d aliases function old new delta unpack_xz_stream_stdin - 3953 +3953 lzma_main - 2601 +2601 lzma_len - 516 +516 dec_vli - 165 +165 dict_repeat - 103 +103 lzma_reset - 98 +98 fill_temp - 98 +98 crc32_validate - 93 +93 xz_dec_reset - 77 +77 unxz_main - 77 +77 index_update - 47 +47 xz_crc32 - 40 +40 packed_usage 27044 27060 +16 make_new_name_unxz - 14 +14 applet_names 2240 2254 +14 applet_main 1312 1324 +12 applet_nameofs 656 662 +6 unpack_unxz - 5 +5 send_tree 355 360 +5 applet_install_loc 164 166 +2 ------------------------------------------------------------------------------ (add/remove: 15/0 grow/shrink: 6/0 up/down: 7942/0) Total: 7942 bytes text data bss dec hex filename 844032 453 6812 851297 cfd61 busybox_old 852063 453 6812 859328 d1cc0 busybox_unstripped Signed-off-by: Denys Vlasenko --- archival/libunarchive/unxz/xz_stream.h | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 archival/libunarchive/unxz/xz_stream.h (limited to 'archival/libunarchive/unxz/xz_stream.h') diff --git a/archival/libunarchive/unxz/xz_stream.h b/archival/libunarchive/unxz/xz_stream.h new file mode 100644 index 000000000..efbe75ae3 --- /dev/null +++ b/archival/libunarchive/unxz/xz_stream.h @@ -0,0 +1,46 @@ +/* + * Definitions for handling the .xz file format + * + * Author: Lasse Collin + * + * This file has been put into the public domain. + * You can do whatever you want with this file. + */ + +#ifndef XZ_STREAM_H +#define XZ_STREAM_H + +#if defined(__KERNEL__) && !defined(XZ_INTERNAL_CRC32) +# include +# undef crc32 +# define xz_crc32(crc32_table, buf, size, crc) \ + (~crc32_le(~(uint32_t)(crc), buf, size)) +#endif + +/* + * See the .xz file format specification at + * http://tukaani.org/xz/xz-file-format.txt + * to understand the container format. + */ + +#define STREAM_HEADER_SIZE 12 + +#define HEADER_MAGIC "\3757zXZ\0" +#define HEADER_MAGIC_SIZE 6 + +#define FOOTER_MAGIC "YZ" +#define FOOTER_MAGIC_SIZE 2 + +/* + * Variable-length integer can hold a 63-bit unsigned integer, or a special + * value to indicate that the value is unknown. + */ +typedef uint64_t vli_type; + +#define VLI_MAX ((vli_type)-1 / 2) +#define VLI_UNKNOWN ((vli_type)-1) + +/* Maximum encoded size of a VLI */ +#define VLI_BYTES_MAX (sizeof(vli_type) * 8 / 7) + +#endif -- cgit v1.2.3