2007-12-08 23:42:33 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2008-08-28 21:53:15 +02:00
|
|
|
/// \file stream_flags_common.h
|
|
|
|
/// \brief Common stuff for Stream flags coders
|
2007-12-08 23:42:33 +01:00
|
|
|
//
|
2009-04-13 10:27:40 +02:00
|
|
|
// Author: Lasse Collin
|
2007-12-08 23:42:33 +01:00
|
|
|
//
|
2009-04-13 10:27:40 +02:00
|
|
|
// This file has been put into the public domain.
|
|
|
|
// You can do whatever you want with this file.
|
2007-12-08 23:42:33 +01:00
|
|
|
//
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2008-08-28 21:53:15 +02:00
|
|
|
#ifndef LZMA_STREAM_FLAGS_COMMON_H
|
|
|
|
#define LZMA_STREAM_FLAGS_COMMON_H
|
2007-12-08 23:42:33 +01:00
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
2008-06-18 17:02:10 +02:00
|
|
|
/// Size of the Stream Flags field
|
|
|
|
#define LZMA_STREAM_FLAGS_SIZE 2
|
|
|
|
|
2007-12-08 23:42:33 +01:00
|
|
|
extern const uint8_t lzma_header_magic[6];
|
|
|
|
extern const uint8_t lzma_footer_magic[2];
|
|
|
|
|
2008-09-12 21:41:40 +02:00
|
|
|
|
|
|
|
static inline bool
|
|
|
|
is_backward_size_valid(const lzma_stream_flags *options)
|
|
|
|
{
|
|
|
|
return options->backward_size >= LZMA_BACKWARD_SIZE_MIN
|
|
|
|
&& options->backward_size <= LZMA_BACKWARD_SIZE_MAX
|
|
|
|
&& (options->backward_size & 3) == 0;
|
|
|
|
}
|
|
|
|
|
2007-12-08 23:42:33 +01:00
|
|
|
#endif
|