From b465da5988dd59ad98fda10c2e4ea13d0b9c73bc Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Sat, 23 Mar 2013 19:17:33 +0200 Subject: liblzma: Add lzma_block_uncomp_encode(). This also adds a new internal function lzma_block_buffer_bound64() which is similar to lzma_block_buffer_bound() but uses uint64_t instead of size_t. --- src/liblzma/api/lzma/block.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/liblzma/api') diff --git a/src/liblzma/api/lzma/block.h b/src/liblzma/api/lzma/block.h index 0d77f32e..e450ad69 100644 --- a/src/liblzma/api/lzma/block.h +++ b/src/liblzma/api/lzma/block.h @@ -496,6 +496,24 @@ extern LZMA_API(lzma_ret) lzma_block_buffer_encode( lzma_nothrow lzma_attr_warn_unused_result; +/** + * \brief Single-call uncompress .xz Block encoder + * + * This is like lzma_block_buffer_encode() except this doesn't try to + * compress the data and instead encodes the data using LZMA2 uncompressed + * chunks. The required output buffer size can be determined with + * lzma_block_buffer_bound(). + * + * Since the data won't be compressed, this function ignores block->filters. + * This function doesn't take lzma_allocator because this function doesn't + * allocate any memory from the heap. + */ +extern LZMA_API(lzma_ret) lzma_block_uncomp_encode(lzma_block *block, + const uint8_t *in, size_t in_size, + uint8_t *out, size_t *out_pos, size_t out_size) + lzma_nothrow lzma_attr_warn_unused_result; + + /** * \brief Single-call .xz Block decoder * -- cgit v1.2.3