blob: a25713c031a51213edc9dd5a32de73f64f75c44f [file] [log] [blame]
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +01001#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 Lougherd7f2ff62011-05-26 10:39:56 +01007 * Phillip Lougher <phillip@squashfs.org.uk>
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +01008 *
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
26struct squashfs_decompressor {
Phillip Lougher9508c6b2013-11-13 02:56:26 +000027 void *(*init)(struct squashfs_sb_info *, void *);
28 void *(*comp_opts)(struct squashfs_sb_info *, void *, int);
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +010029 void (*free)(void *);
Phillip Lougher846b7302013-11-18 02:59:12 +000030 int (*decompress)(struct squashfs_sb_info *, void *,
31 struct buffer_head **, int, int, int,
32 struct squashfs_page_actor *);
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +010033 int id;
34 char *name;
35 int supported;
36};
37
Phillip Lougher9508c6b2013-11-13 02:56:26 +000038static inline void *squashfs_comp_opts(struct squashfs_sb_info *msblk,
39 void *buff, int length)
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +010040{
Phillip Lougher9508c6b2013-11-13 02:56:26 +000041 return msblk->decompressor->comp_opts ?
42 msblk->decompressor->comp_opts(msblk, buff, length) : NULL;
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +010043}
Phillip Lougher7a43ae52010-12-09 02:08:31 +000044
45#ifdef CONFIG_SQUASHFS_XZ
46extern const struct squashfs_decompressor squashfs_xz_comp_ops;
47#endif
48
Phillip Lougher62421642014-11-27 18:48:44 +000049#ifdef CONFIG_SQUASHFS_LZ4
50extern const struct squashfs_decompressor squashfs_lz4_comp_ops;
51#endif
52
Phillip Lougher01a678c2011-01-05 18:23:53 +000053#ifdef CONFIG_SQUASHFS_LZO
54extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
55#endif
56
Phillip Loughercc6d3492011-07-22 03:01:28 +010057#ifdef CONFIG_SQUASHFS_ZLIB
58extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
59#endif
60
Phillip Lougher4c0f0bb2009-10-06 04:04:15 +010061#endif