Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 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 |
Phillip Lougher | d7f2ff6 | 2011-05-26 10:39:56 +0100 | [diff] [blame] | 7 | * Phillip Lougher <phillip@squashfs.org.uk> |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 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 | |
| 26 | struct squashfs_decompressor { |
Phillip Lougher | 9508c6b | 2013-11-13 02:56:26 +0000 | [diff] [blame^] | 27 | void *(*init)(struct squashfs_sb_info *, void *); |
| 28 | void *(*comp_opts)(struct squashfs_sb_info *, void *, int); |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 29 | void (*free)(void *); |
Phillip Lougher | 9508c6b | 2013-11-13 02:56:26 +0000 | [diff] [blame^] | 30 | int (*decompress)(struct squashfs_sb_info *, void *, void **, |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 31 | struct buffer_head **, int, int, int, int, int); |
| 32 | int id; |
| 33 | char *name; |
| 34 | int supported; |
| 35 | }; |
| 36 | |
Phillip Lougher | 9508c6b | 2013-11-13 02:56:26 +0000 | [diff] [blame^] | 37 | static inline void *squashfs_comp_opts(struct squashfs_sb_info *msblk, |
| 38 | void *buff, int length) |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 39 | { |
Phillip Lougher | 9508c6b | 2013-11-13 02:56:26 +0000 | [diff] [blame^] | 40 | return msblk->decompressor->comp_opts ? |
| 41 | msblk->decompressor->comp_opts(msblk, buff, length) : NULL; |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 42 | } |
Phillip Lougher | 7a43ae5 | 2010-12-09 02:08:31 +0000 | [diff] [blame] | 43 | |
| 44 | #ifdef CONFIG_SQUASHFS_XZ |
| 45 | extern const struct squashfs_decompressor squashfs_xz_comp_ops; |
| 46 | #endif |
| 47 | |
Phillip Lougher | 01a678c | 2011-01-05 18:23:53 +0000 | [diff] [blame] | 48 | #ifdef CONFIG_SQUASHFS_LZO |
| 49 | extern const struct squashfs_decompressor squashfs_lzo_comp_ops; |
| 50 | #endif |
| 51 | |
Phillip Lougher | cc6d349 | 2011-07-22 03:01:28 +0100 | [diff] [blame] | 52 | #ifdef CONFIG_SQUASHFS_ZLIB |
| 53 | extern const struct squashfs_decompressor squashfs_zlib_comp_ops; |
| 54 | #endif |
| 55 | |
Phillip Lougher | 4c0f0bb | 2009-10-06 04:04:15 +0100 | [diff] [blame] | 56 | #endif |