summaryrefslogtreecommitdiffstats
path: root/depends/xz-embedded/src/xz_stream.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-09-28 18:43:30 +0200
committerPetr Mrázek <peterix@gmail.com>2013-09-28 18:43:30 +0200
commitd267d86f6e24c4f947c30c1a3642d57b82f8addd (patch)
treea0c0cc7ced7f8d38ea5c12108ded83c762fba2f9 /depends/xz-embedded/src/xz_stream.h
parentd903b0f0ea4bbeb6a20771575295ea28795dc5d7 (diff)
downloadMultiMC-d267d86f6e24c4f947c30c1a3642d57b82f8addd.tar
MultiMC-d267d86f6e24c4f947c30c1a3642d57b82f8addd.tar.gz
MultiMC-d267d86f6e24c4f947c30c1a3642d57b82f8addd.tar.lz
MultiMC-d267d86f6e24c4f947c30c1a3642d57b82f8addd.tar.xz
MultiMC-d267d86f6e24c4f947c30c1a3642d57b82f8addd.zip
Replace lzma with xz. Tweaks to fix debug builds.
Diffstat (limited to 'depends/xz-embedded/src/xz_stream.h')
-rw-r--r--depends/xz-embedded/src/xz_stream.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/depends/xz-embedded/src/xz_stream.h b/depends/xz-embedded/src/xz_stream.h
new file mode 100644
index 00000000..66cb5a70
--- /dev/null
+++ b/depends/xz-embedded/src/xz_stream.h
@@ -0,0 +1,62 @@
+/*
+ * Definitions for handling the .xz file format
+ *
+ * Author: Lasse Collin <lasse.collin@tukaani.org>
+ *
+ * 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__) && !XZ_INTERNAL_CRC32
+# include <linux/crc32.h>
+# undef crc32
+# define xz_crc32(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"
+#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 indicating that the value is unknown.
+ *
+ * Experimental: vli_type can be defined to uint32_t to save a few bytes
+ * in code size (no effect on speed). Doing so limits the uncompressed and
+ * compressed size of the file to less than 256 MiB and may also weaken
+ * error detection slightly.
+ */
+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)
+
+/* Integrity Check types */
+enum xz_check {
+ XZ_CHECK_NONE = 0,
+ XZ_CHECK_CRC32 = 1,
+ XZ_CHECK_CRC64 = 4,
+ XZ_CHECK_SHA256 = 10
+};
+
+/* Maximum possible Check ID */
+#define XZ_CHECK_MAX 15
+
+#endif