aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/stream_flags_common.h
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-09-12 22:41:40 +0300
committerLasse Collin <lasse.collin@tukaani.org>2008-09-12 22:41:40 +0300
commit320601b2c7b08fc7da9da18d5bf7c3c1a189b080 (patch)
tree3846af51e6904d900e5cd8337baf0728a42a07fe /src/liblzma/common/stream_flags_common.h
parentSimplified debug/known_sizes.c to match the relaxed (diff)
downloadxz-320601b2c7b08fc7da9da18d5bf7c3c1a189b080.tar.xz
Improved the Stream Flags handling API.
Diffstat (limited to '')
-rw-r--r--src/liblzma/common/stream_flags_common.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/liblzma/common/stream_flags_common.h b/src/liblzma/common/stream_flags_common.h
index 6e57857b..f422b02a 100644
--- a/src/liblzma/common/stream_flags_common.h
+++ b/src/liblzma/common/stream_flags_common.h
@@ -28,4 +28,13 @@
extern const uint8_t lzma_header_magic[6];
extern const uint8_t lzma_footer_magic[2];
+
+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;
+}
+
#endif