xref: /aosp_15_r20/external/erofs-utils/include/erofs/decompress.h (revision 33b1fccf6a0fada2c2875d400ed01119b7676ee5)
1*33b1fccfSAndroid Build Coastguard Worker /* SPDX-License-Identifier: GPL-2.0+ OR Apache-2.0 */
2*33b1fccfSAndroid Build Coastguard Worker /*
3*33b1fccfSAndroid Build Coastguard Worker  * Copyright (C), 2008-2020, OPPO Mobile Comm Corp., Ltd.
4*33b1fccfSAndroid Build Coastguard Worker  * Created by Huang Jianan <[email protected]>
5*33b1fccfSAndroid Build Coastguard Worker  */
6*33b1fccfSAndroid Build Coastguard Worker #ifndef __EROFS_DECOMPRESS_H
7*33b1fccfSAndroid Build Coastguard Worker #define __EROFS_DECOMPRESS_H
8*33b1fccfSAndroid Build Coastguard Worker 
9*33b1fccfSAndroid Build Coastguard Worker #ifdef __cplusplus
10*33b1fccfSAndroid Build Coastguard Worker extern "C"
11*33b1fccfSAndroid Build Coastguard Worker {
12*33b1fccfSAndroid Build Coastguard Worker #endif
13*33b1fccfSAndroid Build Coastguard Worker 
14*33b1fccfSAndroid Build Coastguard Worker #include "internal.h"
15*33b1fccfSAndroid Build Coastguard Worker 
16*33b1fccfSAndroid Build Coastguard Worker struct z_erofs_decompress_req {
17*33b1fccfSAndroid Build Coastguard Worker 	struct erofs_sb_info *sbi;
18*33b1fccfSAndroid Build Coastguard Worker 	char *in, *out;
19*33b1fccfSAndroid Build Coastguard Worker 
20*33b1fccfSAndroid Build Coastguard Worker 	/*
21*33b1fccfSAndroid Build Coastguard Worker 	 * initial decompressed bytes that need to be skipped
22*33b1fccfSAndroid Build Coastguard Worker 	 * when finally copying to output buffer
23*33b1fccfSAndroid Build Coastguard Worker 	 */
24*33b1fccfSAndroid Build Coastguard Worker 	unsigned int decodedskip;
25*33b1fccfSAndroid Build Coastguard Worker 	unsigned int inputsize, decodedlength;
26*33b1fccfSAndroid Build Coastguard Worker 
27*33b1fccfSAndroid Build Coastguard Worker 	/* cut point of interlaced uncompressed data */
28*33b1fccfSAndroid Build Coastguard Worker 	unsigned int interlaced_offset;
29*33b1fccfSAndroid Build Coastguard Worker 
30*33b1fccfSAndroid Build Coastguard Worker 	/* indicate the algorithm will be used for decompression */
31*33b1fccfSAndroid Build Coastguard Worker 	unsigned int alg;
32*33b1fccfSAndroid Build Coastguard Worker 	bool partial_decoding;
33*33b1fccfSAndroid Build Coastguard Worker };
34*33b1fccfSAndroid Build Coastguard Worker 
35*33b1fccfSAndroid Build Coastguard Worker int z_erofs_decompress(struct z_erofs_decompress_req *rq);
36*33b1fccfSAndroid Build Coastguard Worker 
37*33b1fccfSAndroid Build Coastguard Worker #ifdef __cplusplus
38*33b1fccfSAndroid Build Coastguard Worker }
39*33b1fccfSAndroid Build Coastguard Worker #endif
40*33b1fccfSAndroid Build Coastguard Worker 
41*33b1fccfSAndroid Build Coastguard Worker #endif
42