libaaruformat 1.0 Aaru Data Preservation Suite - Format Library

Loading...
Searching...
No Matches
lzma.c
Go to the documentation of this file.
1/*
2 * This file is part of the Aaru Data Preservation Suite.
3 * Copyright (c) 2019-2025 Natalia Portillo.
4 *
5 * This library is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation; either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include <stddef.h>
20#include <stdint.h>
21
22#include "aaruformat.h"
23
24#include "../../3rdparty/lzma-21.03beta/C/LzmaLib.h"
25
39 AARU_EXPORT int32_t AARU_CALL aaruf_lzma_decode_buffer(uint8_t *dst_buffer, size_t *dst_size, const uint8_t *src_buffer,
40 size_t *src_len, const uint8_t *props, const size_t props_size)
41{
42 return LzmaUncompress(dst_buffer, dst_size, src_buffer, src_len, props, props_size);
43}
44
65 AARU_EXPORT int32_t AARU_CALL aaruf_lzma_encode_buffer(uint8_t *dst_buffer, size_t *dst_size, const uint8_t *src_buffer,
66 const size_t src_len, uint8_t *out_props, size_t *out_props_size,
67 const int32_t level, const uint32_t dict_size, const int32_t lc,
68 const int32_t lp, const int32_t pb, const int32_t fb,
69 const int32_t num_threads)
70{
71 return LzmaCompress(dst_buffer, dst_size, src_buffer, src_len, out_props, out_props_size, level, dict_size, lc, lp,
72 pb, fb, num_threads);
73}
aaruformat.h
AARU_CALL
#define AARU_CALL
Definition decls.h:45
AARU_EXPORT
#define AARU_EXPORT
Definition decls.h:54
aaruf_lzma_encode_buffer
int32_t aaruf_lzma_encode_buffer(uint8_t *dst_buffer, size_t *dst_size, const uint8_t *src_buffer, const size_t src_len, uint8_t *out_props, size_t *out_props_size, const int32_t level, const uint32_t dict_size, const int32_t lc, const int32_t lp, const int32_t pb, const int32_t fb, const int32_t num_threads)
Encodes a buffer using LZMA compression.
Definition lzma.c:65
aaruf_lzma_decode_buffer
int32_t aaruf_lzma_decode_buffer(uint8_t *dst_buffer, size_t *dst_size, const uint8_t *src_buffer, size_t *src_len, const uint8_t *props, const size_t props_size)
Decodes an LZMA-compressed buffer.
Definition lzma.c:39