libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
Loading...
Searching...
No Matches
lzma.c File Reference
#include <stddef.h>
#include <stdint.h>
#include "aaruformat.h"
#include "../../3rdparty/lzma-21.03beta/C/LzmaLib.h"

Go to the source code of this file.

Functions

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.
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.

Function Documentation

◆ 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.

Decompresses data from the source buffer into the destination buffer using LZMA.

Parameters
dst_bufferPointer to the destination buffer.
dst_sizePointer to the size of the destination buffer; updated with the actual size.
src_bufferPointer to the source (compressed) buffer.
src_lenPointer to the size of the source buffer; updated with the actual size read.
propsPointer to the LZMA properties.
props_sizeSize of the LZMA properties.
Returns
0 on success, or an error code on failure.

Definition at line 39 of file lzma.c.

References AARU_CALL, and AARU_EXPORT.

Referenced by aaruf_read_sector(), decode_ddt_multi_level_v2(), process_data_block(), process_ddt_v1(), and process_ddt_v2().

◆ 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.

Compresses data from the source buffer into the destination buffer using LZMA.

Parameters
dst_bufferPointer to the destination buffer.
dst_sizePointer to the size of the destination buffer; updated with the actual size.
src_bufferPointer to the source (uncompressed) buffer.
src_lenSize of the source buffer.
out_propsPointer to the output LZMA properties.
out_props_sizePointer to the size of the output LZMA properties.
levelCompression level.
dict_sizeDictionary size.
lcLZMA literal context bits.
lpLZMA literal position bits.
pbLZMA position bits.
fbNumber of fast bytes.
num_threadsNumber of threads to use.
Returns
0 on success, or an error code on failure.

Definition at line 65 of file lzma.c.

References AARU_CALL, and AARU_EXPORT.

Referenced by aaruf_close_current_block(), set_ddt_multi_level_v2(), write_cached_secondary_ddt(), write_dvd_long_sector_blocks(), write_dvd_title_key_decrypted_block(), write_media_tags(), write_mode2_subheaders_block(), write_sector_prefix(), write_sector_prefix_ddt(), write_sector_subchannel(), write_sector_suffix(), write_sector_suffix_ddt(), and write_single_level_ddt().