-
Notifications
You must be signed in to change notification settings - Fork 0
/
sqfs_decompressor.h
61 lines (48 loc) · 1.22 KB
/
sqfs_decompressor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2020 Bootlin
*
* Author: Joao Marcos Costa <[email protected]>
*
* sqfs_decompressor.h: function prototypes and struct definitions,
* included at sqfs_decompressor.c
*/
#ifndef SQFS_DECOMPRESSOR_H
#define SQFS_DECOMPRESSOR_H
#include <stdint.h>
/* LZMA does not support any compression options */
struct gzip_opts {
uint32_t compression_level;
uint16_t window_size;
uint16_t strategies;
};
struct xz_opts {
uint32_t dictionary_size;
uint32_t executable_filters;
};
struct lz4_opts {
uint32_t version;
uint32_t flags;
};
struct zstd_opts {
uint32_t compression_level;
};
struct lzo_opts {
uint32_t algorithm;
uint32_t level;
};
union sqfs_compression_opts {
struct gzip_opts *gzip;
struct xz_opts *xz;
struct lz4_opts *lz4;
struct zstd_opts *zstd;
struct lzo_opts *lzo;
};
enum squashfs_compression_type;
int sqfs_fill_compression_opts(union sqfs_compression_opts *opts,
int compression, void *file_mapping);
int sqfs_dump_compression_opts(int compression,
union sqfs_compression_opts *opts);
int sqfs_decompress(void *dest, size_t *dest_len, const void *source,
size_t source_len);
#endif /* SQFS_DECOMPRESSOR_H */