decompressor.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef DECOMPRESSOR_H
  2. #define DECOMPRESSOR_H
  3. /*
  4. * Squashfs - a compressed read only filesystem for Linux
  5. *
  6. * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
  7. * Phillip Lougher <phillip@squashfs.org.uk>
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version 2,
  12. * or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  22. *
  23. * decompressor.h
  24. */
  25. struct squashfs_decompressor {
  26. void *(*init)(struct squashfs_sb_info *, void *);
  27. void *(*comp_opts)(struct squashfs_sb_info *, void *, int);
  28. void (*free)(void *);
  29. int (*decompress)(struct squashfs_sb_info *, void *,
  30. struct buffer_head **, int, int, int,
  31. struct squashfs_page_actor *);
  32. int id;
  33. char *name;
  34. int supported;
  35. };
  36. static inline void *squashfs_comp_opts(struct squashfs_sb_info *msblk,
  37. void *buff, int length)
  38. {
  39. return msblk->decompressor->comp_opts ?
  40. msblk->decompressor->comp_opts(msblk, buff, length) : NULL;
  41. }
  42. #ifdef CONFIG_SQUASHFS_XZ
  43. extern const struct squashfs_decompressor squashfs_xz_comp_ops;
  44. #endif
  45. #ifdef CONFIG_SQUASHFS_LZ4
  46. extern const struct squashfs_decompressor squashfs_lz4_comp_ops;
  47. #endif
  48. #ifdef CONFIG_SQUASHFS_LZO
  49. extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
  50. #endif
  51. #ifdef CONFIG_SQUASHFS_ZLIB
  52. extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
  53. #endif
  54. #endif