/*
 * 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
s Klauser</td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit.cgi/linux/net-next.git/'>summary</a><a href='/cgit.cgi/linux/net-next.git/refs/?id=e9904990e8e70a51574e6ec6b872f3c705ec75f0'>refs</a><a class='active' href='/cgit.cgi/linux/net-next.git/log/net/mac80211/rc80211_minstrel_debugfs.c'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/net/mac80211/rc80211_minstrel_debugfs.c?id=e9904990e8e70a51574e6ec6b872f3c705ec75f0'>tree</a><a href='/cgit.cgi/linux/net-next.git/commit/net/mac80211/rc80211_minstrel_debugfs.c?id=e9904990e8e70a51574e6ec6b872f3c705ec75f0'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/net/mac80211/rc80211_minstrel_debugfs.c?id=e9904990e8e70a51574e6ec6b872f3c705ec75f0'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/net/mac80211/rc80211_minstrel_debugfs.c'>
<input type='hidden' name='id' value='e9904990e8e70a51574e6ec6b872f3c705ec75f0'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/log/?id=e9904990e8e70a51574e6ec6b872f3c705ec75f0'>root</a>/<a href='/cgit.cgi/linux/net-next.git/log/net?id=e9904990e8e70a51574e6ec6b872f3c705ec75f0'>net</a>/<a href='/cgit.cgi/linux/net-next.git/log/net/mac80211?id=e9904990e8e70a51574e6ec6b872f3c705ec75f0'>mac80211</a>/<a href='/cgit.cgi/linux/net-next.git/log/net/mac80211/rc80211_minstrel_debugfs.c?id=e9904990e8e70a51574e6ec6b872f3c705ec75f0'>rc80211_minstrel_debugfs.c</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th class='left'>Age</th><th class='left'>Commit message (<a href='/cgit.cgi/linux/net-next.git/log/net/mac80211/rc80211_minstrel_debugfs.c?id=e9904990e8e70a51574e6ec6b872f3c705ec75f0&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Files</th><th class='left'>Lines</th></tr>