File indexing completed on 2025-05-11 08:24:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef XZ_STREAM_H
0011 #define XZ_STREAM_H
0012
0013 #if defined(__KERNEL__) && !XZ_INTERNAL_CRC32
0014 # include <linux/crc32.h>
0015 # undef crc32
0016 # define xz_crc32(buf, size, crc) \
0017 (~crc32_le(~(uint32_t)(crc), buf, size))
0018 #endif
0019
0020
0021
0022
0023
0024
0025
0026 #define STREAM_HEADER_SIZE 12
0027
0028 #define HEADER_MAGIC "\3757zXZ"
0029 #define HEADER_MAGIC_SIZE 6
0030
0031 #define FOOTER_MAGIC "YZ"
0032 #define FOOTER_MAGIC_SIZE 2
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 typedef uint64_t vli_type;
0044
0045 #define VLI_MAX ((vli_type)-1 / 2)
0046 #define VLI_UNKNOWN ((vli_type)-1)
0047
0048
0049 #define VLI_BYTES_MAX (sizeof(vli_type) * 8 / 7)
0050
0051
0052 enum xz_check {
0053 XZ_CHECK_NONE = 0,
0054 XZ_CHECK_CRC32 = 1,
0055 XZ_CHECK_CRC64 = 4,
0056 XZ_CHECK_SHA256 = 10
0057 };
0058
0059
0060 #define XZ_CHECK_MAX 15
0061
0062 #endif