Loading...
Searching...
No Matches
lzma.c
Go to the documentation of this file.
/*
* This file is part of the Aaru Data Preservation Suite.
* Copyright (c) 2019-2026 Natalia Portillo.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the
* License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stddef.h>
#include <stdint.h>
#include "aaruformat.h"
#include "../../3rdparty/lzma-21.03beta/C/LzmaLib.h"
AARU_EXPORT int32_t AARU_CALL 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)
{
return LzmaUncompress(dst_buffer, dst_size, src_buffer, src_len, props, props_size);
}
AARU_EXPORT int32_t AARU_CALL 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)
{
return LzmaCompress(dst_buffer, dst_size, src_buffer, src_len, out_props, out_props_size, level, dict_size, lc, lp,
pb, fb, num_threads);
}
aaruformat.h
AARU_CALL
#define AARU_CALL
Definition decls.h:46
AARU_EXPORT
#define AARU_EXPORT
Definition decls.h:55
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