stream_flags_common.h 883 B

12345678910111213141516171819202122232425262728293031323334
  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. /// \file stream_flags_common.h
  4. /// \brief Common stuff for Stream flags coders
  5. //
  6. // Author: Lasse Collin
  7. //
  8. // This file has been put into the public domain.
  9. // You can do whatever you want with this file.
  10. //
  11. ///////////////////////////////////////////////////////////////////////////////
  12. #ifndef LZMA_STREAM_FLAGS_COMMON_H
  13. #define LZMA_STREAM_FLAGS_COMMON_H
  14. #include "common.h"
  15. /// Size of the Stream Flags field
  16. #define LZMA_STREAM_FLAGS_SIZE 2
  17. extern const uint8_t lzma_header_magic[6];
  18. extern const uint8_t lzma_footer_magic[2];
  19. static inline bool
  20. is_backward_size_valid(const lzma_stream_flags *options)
  21. {
  22. return options->backward_size >= LZMA_BACKWARD_SIZE_MIN
  23. && options->backward_size <= LZMA_BACKWARD_SIZE_MAX
  24. && (options->backward_size & 3) == 0;
  25. }
  26. #endif