sqfs_decompressor.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2020 Bootlin
  4. *
  5. * Author: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
  6. */
  7. #ifndef SQFS_DECOMPRESSOR_H
  8. #define SQFS_DECOMPRESSOR_H
  9. #include <stdint.h>
  10. #define SQFS_COMP_ZLIB 1
  11. #define SQFS_COMP_LZMA 2
  12. #define SQFS_COMP_LZO 3
  13. #define SQFS_COMP_XZ 4
  14. #define SQFS_COMP_LZ4 5
  15. #define SQFS_COMP_ZSTD 6
  16. /* LZMA does not support any compression options */
  17. struct squashfs_gzip_opts {
  18. u32 compression_level;
  19. u16 window_size;
  20. u16 strategies;
  21. };
  22. struct squashfs_xz_opts {
  23. u32 dictionary_size;
  24. u32 executable_filters;
  25. };
  26. struct squashfs_lz4_opts {
  27. u32 version;
  28. u32 flags;
  29. };
  30. struct squashfs_zstd_opts {
  31. u32 compression_level;
  32. };
  33. struct squashfs_lzo_opts {
  34. u32 algorithm;
  35. u32 level;
  36. };
  37. union squashfs_compression_opts {
  38. struct squashfs_gzip_opts *gzip;
  39. struct squashfs_xz_opts *xz;
  40. struct squashfs_lz4_opts *lz4;
  41. struct squashfs_zstd_opts *zstd;
  42. struct squashfs_lzo_opts *lzo;
  43. };
  44. int sqfs_decompress(u16 comp_type, void *dest, unsigned long *dest_len,
  45. void *source, u32 lenp);
  46. #endif /* SQFS_DECOMPRESSOR_H */