Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/bdk/libs/compr/blz.h
1476 views
1
/*
2
* Copyright (c) 2018 rajkosto
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms and conditions of the GNU General Public License,
6
* version 2, as published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
* more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*/
16
17
#ifndef _BLZ_H_
18
#define _BLZ_H_
19
20
#include <utils/types.h>
21
22
typedef struct _blz_footer
23
{
24
u32 cmp_and_hdr_size;
25
u32 header_size;
26
u32 addl_size;
27
} blz_footer;
28
29
// Returns pointer to footer in comp_data if present, additionally copies it to out_footer if not NULL.
30
const blz_footer *blz_get_footer(const u8 *comp_data, u32 comp_data_size, blz_footer *out_footer);
31
// Returns 0 on failure.
32
int blz_uncompress_inplace(u8 *data, u32 comp_size, const blz_footer *footer);
33
// Returns 0 on failure.
34
int blz_uncompress_srcdest(const u8 *comp_data, u32 comp_data_size, u8 *dst_data, u32 dst_size);
35
36
#endif
37
38