container.h | container.h | |||
---|---|---|---|---|
skipping to change at line 59 | skipping to change at line 59 | |||
* This flag modifies the preset to make the encoding significantly slower | * This flag modifies the preset to make the encoding significantly slower | |||
* while improving the compression ratio only marginally. This is useful | * while improving the compression ratio only marginally. This is useful | |||
* when you don't mind wasting time to get as small result as possible. | * when you don't mind wasting time to get as small result as possible. | |||
* | * | |||
* This flag doesn't affect the memory usage requirements of the decoder (a t | * This flag doesn't affect the memory usage requirements of the decoder (a t | |||
* least not significantly). The memory usage of the encoder may be increas ed | * least not significantly). The memory usage of the encoder may be increas ed | |||
* a little but only at the lowest preset levels (0-3). | * a little but only at the lowest preset levels (0-3). | |||
*/ | */ | |||
#define LZMA_PRESET_EXTREME (UINT32_C(1) << 31) | #define LZMA_PRESET_EXTREME (UINT32_C(1) << 31) | |||
#ifdef LZMA_UNSTABLE /* Unstable API that may change. Use only for testing. */ | ||||
/** | /** | |||
* \brief Multithreading options | * \brief Multithreading options | |||
*/ | */ | |||
typedef struct { | typedef struct { | |||
/** | /** | |||
* \brief Flags | * \brief Flags | |||
* | * | |||
* Set this to zero if no flags are wanted. | * Set this to zero if no flags are wanted. | |||
* | * | |||
* No flags are currently supported. | * No flags are currently supported. | |||
skipping to change at line 96 | skipping to change at line 95 | |||
* dictionary size. With very small dictionaries, it is recommended | * dictionary size. With very small dictionaries, it is recommended | |||
* to use at least 1 MiB block size for good compression ratio, even | * to use at least 1 MiB block size for good compression ratio, even | |||
* if this is more than four times the dictionary size. Note that | * if this is more than four times the dictionary size. Note that | |||
* these are only recommendations for typical use cases; feel free | * these are only recommendations for typical use cases; feel free | |||
* to use other values. Just keep in mind that using a block size | * to use other values. Just keep in mind that using a block size | |||
* less than the LZMA2 dictionary size is waste of RAM. | * less than the LZMA2 dictionary size is waste of RAM. | |||
* | * | |||
* Set this to 0 to let liblzma choose the block size depending | * Set this to 0 to let liblzma choose the block size depending | |||
* on the compression options. For LZMA2 it will be 3*dict_size | * on the compression options. For LZMA2 it will be 3*dict_size | |||
* or 1 MiB, whichever is more. | * or 1 MiB, whichever is more. | |||
* | ||||
* For each thread, about 3 * block_size bytes of memory will be | ||||
* allocated. This may change in later liblzma versions. If so, | ||||
* the memory usage will probably be reduced, not increased. | ||||
*/ | */ | |||
uint64_t block_size; | uint64_t block_size; | |||
/** | /** | |||
* \brief Timeout to allow lzma_code() to return early | * \brief Timeout to allow lzma_code() to return early | |||
* | * | |||
* Multithreading can make liblzma to consume input and produce | * Multithreading can make liblzma to consume input and produce | |||
* output in a very bursty way: it may first read a lot of input | * output in a very bursty way: it may first read a lot of input | |||
* to fill internal buffers, then no input or output occurs for | * to fill internal buffers, then no input or output occurs for | |||
* a while. | * a while. | |||
skipping to change at line 179 | skipping to change at line 182 | |||
uint64_t reserved_int5; | uint64_t reserved_int5; | |||
uint64_t reserved_int6; | uint64_t reserved_int6; | |||
uint64_t reserved_int7; | uint64_t reserved_int7; | |||
uint64_t reserved_int8; | uint64_t reserved_int8; | |||
void *reserved_ptr1; | void *reserved_ptr1; | |||
void *reserved_ptr2; | void *reserved_ptr2; | |||
void *reserved_ptr3; | void *reserved_ptr3; | |||
void *reserved_ptr4; | void *reserved_ptr4; | |||
} lzma_mt; | } lzma_mt; | |||
#endif | ||||
/** | /** | |||
* \brief Calculate approximate memory usage of easy encoder | * \brief Calculate approximate memory usage of easy encoder | |||
* | * | |||
* This function is a wrapper for lzma_raw_encoder_memusage(). | * This function is a wrapper for lzma_raw_encoder_memusage(). | |||
* | * | |||
* \param preset Compression preset (level and possible flags) | * \param preset Compression preset (level and possible flags) | |||
* | * | |||
* \return Number of bytes of memory required for the given | * \return Number of bytes of memory required for the given | |||
* preset when encoding. If an error occurs, for example | * preset when encoding. If an error occurs, for example | |||
skipping to change at line 283 | skipping to change at line 285 | |||
* \return - LZMA_OK: Encoding was successful. | * \return - LZMA_OK: Encoding was successful. | |||
* - LZMA_BUF_ERROR: Not enough output buffer space. | * - LZMA_BUF_ERROR: Not enough output buffer space. | |||
* - LZMA_UNSUPPORTED_CHECK | * - LZMA_UNSUPPORTED_CHECK | |||
* - LZMA_OPTIONS_ERROR | * - LZMA_OPTIONS_ERROR | |||
* - LZMA_MEM_ERROR | * - LZMA_MEM_ERROR | |||
* - LZMA_DATA_ERROR | * - LZMA_DATA_ERROR | |||
* - LZMA_PROG_ERROR | * - LZMA_PROG_ERROR | |||
*/ | */ | |||
extern LZMA_API(lzma_ret) lzma_easy_buffer_encode( | extern LZMA_API(lzma_ret) lzma_easy_buffer_encode( | |||
uint32_t preset, lzma_check check, | uint32_t preset, lzma_check check, | |||
lzma_allocator *allocator, const uint8_t *in, size_t in_size | const lzma_allocator *allocator, | |||
, | const uint8_t *in, size_t in_size, | |||
uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow ; | uint8_t *out, size_t *out_pos, size_t out_size) lzma_nothrow ; | |||
/** | /** | |||
* \brief Initialize .xz Stream encoder using a custom filter chain | * \brief Initialize .xz Stream encoder using a custom filter chain | |||
* | * | |||
* \param strm Pointer to properly prepared lzma_stream | * \param strm Pointer to properly prepared lzma_stream | |||
* \param filters Array of filters. This must be terminated with | * \param filters Array of filters. This must be terminated with | |||
* filters[n].id = LZMA_VLI_UNKNOWN. See filter.h for | * filters[n].id = LZMA_VLI_UNKNOWN. See filter.h for | |||
* more information. | * more information. | |||
* \param check Type of the integrity check to calculate from | * \param check Type of the integrity check to calculate from | |||
skipping to change at line 306 | skipping to change at line 309 | |||
* \return - LZMA_OK: Initialization was successful. | * \return - LZMA_OK: Initialization was successful. | |||
* - LZMA_MEM_ERROR | * - LZMA_MEM_ERROR | |||
* - LZMA_UNSUPPORTED_CHECK | * - LZMA_UNSUPPORTED_CHECK | |||
* - LZMA_OPTIONS_ERROR | * - LZMA_OPTIONS_ERROR | |||
* - LZMA_PROG_ERROR | * - LZMA_PROG_ERROR | |||
*/ | */ | |||
extern LZMA_API(lzma_ret) lzma_stream_encoder(lzma_stream *strm, | extern LZMA_API(lzma_ret) lzma_stream_encoder(lzma_stream *strm, | |||
const lzma_filter *filters, lzma_check check) | const lzma_filter *filters, lzma_check check) | |||
lzma_nothrow lzma_attr_warn_unused_result; | lzma_nothrow lzma_attr_warn_unused_result; | |||
#ifdef LZMA_UNSTABLE /* Unstable API that may change. Use only for testing. */ | ||||
/** | /** | |||
* \brief Calculate approximate memory usage of multithreaded .xz enc oder | * \brief Calculate approximate memory usage of multithreaded .xz enc oder | |||
* | * | |||
* Since doing the encoding in threaded mode doesn't affect the memory | * Since doing the encoding in threaded mode doesn't affect the memory | |||
* requirements of single-threaded decompressor, you can use | * requirements of single-threaded decompressor, you can use | |||
* lzma_easy_decoder_memusage(options->preset) or | * lzma_easy_decoder_memusage(options->preset) or | |||
* lzma_raw_decoder_memusage(options->filters) to calculate | * lzma_raw_decoder_memusage(options->filters) to calculate | |||
* the decompressor memory requirements. | * the decompressor memory requirements. | |||
* | * | |||
* \param options Compression options | * \param options Compression options | |||
skipping to change at line 331 | skipping to change at line 333 | |||
*/ | */ | |||
extern LZMA_API(uint64_t) lzma_stream_encoder_mt_memusage( | extern LZMA_API(uint64_t) lzma_stream_encoder_mt_memusage( | |||
const lzma_mt *options) lzma_nothrow lzma_attr_pure; | const lzma_mt *options) lzma_nothrow lzma_attr_pure; | |||
/** | /** | |||
* \brief Initialize multithreaded .xz Stream encoder | * \brief Initialize multithreaded .xz Stream encoder | |||
* | * | |||
* This provides the functionality of lzma_easy_encoder() and | * This provides the functionality of lzma_easy_encoder() and | |||
* lzma_stream_encoder() as a single function for multithreaded use. | * lzma_stream_encoder() as a single function for multithreaded use. | |||
* | * | |||
* TODO: For lzma_code(), only LZMA_RUN and LZMA_FINISH are currently | * The supported actions for lzma_code() are LZMA_RUN, LZMA_FULL_FLUSH, | |||
* supported. Support for other actions has been planned. | * LZMA_FULL_BARRIER, and LZMA_FINISH. Support for LZMA_SYNC_FLUSH might be | |||
* added in the future. | ||||
* | * | |||
* \param strm Pointer to properly prepared lzma_stream | * \param strm Pointer to properly prepared lzma_stream | |||
* \param options Pointer to multithreaded compression options | * \param options Pointer to multithreaded compression options | |||
* | * | |||
* \return - LZMA_OK | * \return - LZMA_OK | |||
* - LZMA_MEM_ERROR | * - LZMA_MEM_ERROR | |||
* - LZMA_UNSUPPORTED_CHECK | * - LZMA_UNSUPPORTED_CHECK | |||
* - LZMA_OPTIONS_ERROR | * - LZMA_OPTIONS_ERROR | |||
* - LZMA_PROG_ERROR | * - LZMA_PROG_ERROR | |||
*/ | */ | |||
extern LZMA_API(lzma_ret) lzma_stream_encoder_mt( | extern LZMA_API(lzma_ret) lzma_stream_encoder_mt( | |||
lzma_stream *strm, const lzma_mt *options) | lzma_stream *strm, const lzma_mt *options) | |||
lzma_nothrow lzma_attr_warn_unused_result; | lzma_nothrow lzma_attr_warn_unused_result; | |||
#endif | ||||
/** | /** | |||
* \brief Initialize .lzma encoder (legacy file format) | * \brief Initialize .lzma encoder (legacy file format) | |||
* | * | |||
* The .lzma format is sometimes called the LZMA_Alone format, which is the | * The .lzma format is sometimes called the LZMA_Alone format, which is the | |||
* reason for the name of this function. The .lzma format supports only the | * reason for the name of this function. The .lzma format supports only the | |||
* LZMA1 filter. There is no support for integrity checks like CRC32. | * LZMA1 filter. There is no support for integrity checks like CRC32. | |||
* | * | |||
* Use this function if and only if you need to create files readable by | * Use this function if and only if you need to create files readable by | |||
* legacy LZMA tools such as LZMA Utils 4.32.x. Moving to the .xz format | * legacy LZMA tools such as LZMA Utils 4.32.x. Moving to the .xz format | |||
skipping to change at line 425 | skipping to change at line 427 | |||
* \return - LZMA_OK: Encoding was successful. | * \return - LZMA_OK: Encoding was successful. | |||
* - LZMA_BUF_ERROR: Not enough output buffer space. | * - LZMA_BUF_ERROR: Not enough output buffer space. | |||
* - LZMA_UNSUPPORTED_CHECK | * - LZMA_UNSUPPORTED_CHECK | |||
* - LZMA_OPTIONS_ERROR | * - LZMA_OPTIONS_ERROR | |||
* - LZMA_MEM_ERROR | * - LZMA_MEM_ERROR | |||
* - LZMA_DATA_ERROR | * - LZMA_DATA_ERROR | |||
* - LZMA_PROG_ERROR | * - LZMA_PROG_ERROR | |||
*/ | */ | |||
extern LZMA_API(lzma_ret) lzma_stream_buffer_encode( | extern LZMA_API(lzma_ret) lzma_stream_buffer_encode( | |||
lzma_filter *filters, lzma_check check, | lzma_filter *filters, lzma_check check, | |||
lzma_allocator *allocator, const uint8_t *in, size_t in_size | const lzma_allocator *allocator, | |||
, | const uint8_t *in, size_t in_size, | |||
uint8_t *out, size_t *out_pos, size_t out_size) | uint8_t *out, size_t *out_pos, size_t out_size) | |||
lzma_nothrow lzma_attr_warn_unused_result; | lzma_nothrow lzma_attr_warn_unused_result; | |||
/************ | /************ | |||
* Decoding * | * Decoding * | |||
************/ | ************/ | |||
/** | /** | |||
* This flag makes lzma_code() return LZMA_NO_CHECK if the input stream | * This flag makes lzma_code() return LZMA_NO_CHECK if the input stream | |||
* being decoded has no integrity check. Note that when used with | * being decoded has no integrity check. Note that when used with | |||
skipping to change at line 457 | skipping to change at line 460 | |||
#define LZMA_TELL_UNSUPPORTED_CHECK UINT32_C(0x02) | #define LZMA_TELL_UNSUPPORTED_CHECK UINT32_C(0x02) | |||
/** | /** | |||
* This flag makes lzma_code() return LZMA_GET_CHECK as soon as the type | * This flag makes lzma_code() return LZMA_GET_CHECK as soon as the type | |||
* of the integrity check is known. The type can then be got with | * of the integrity check is known. The type can then be got with | |||
* lzma_get_check(). | * lzma_get_check(). | |||
*/ | */ | |||
#define LZMA_TELL_ANY_CHECK UINT32_C(0x04) | #define LZMA_TELL_ANY_CHECK UINT32_C(0x04) | |||
/** | /** | |||
* This flag makes lzma_code() not calculate and verify the integrity check | ||||
* of the compressed data in .xz files. This means that invalid integrity | ||||
* check values won't be detected and LZMA_DATA_ERROR won't be returned in | ||||
* such cases. | ||||
* | ||||
* This flag only affects the checks of the compressed data itself; the CRC | ||||
32 | ||||
* values in the .xz headers will still be verified normally. | ||||
* | ||||
* Don't use this flag unless you know what you are doing. Possible reasons | ||||
* to use this flag: | ||||
* | ||||
* - Trying to recover data from a corrupt .xz file. | ||||
* | ||||
* - Speeding up decompression, which matters mostly with SHA-256 | ||||
* or with files that have compressed extremely well. It's recommended | ||||
* to not use this flag for this purpose unless the file integrity is | ||||
* verified externally in some other way. | ||||
* | ||||
* Support for this flag was added in liblzma 5.1.4beta. | ||||
*/ | ||||
#define LZMA_IGNORE_CHECK UINT32_C(0x10) | ||||
/** | ||||
* This flag enables decoding of concatenated files with file formats that | * This flag enables decoding of concatenated files with file formats that | |||
* allow concatenating compressed files as is. From the formats currently | * allow concatenating compressed files as is. From the formats currently | |||
* supported by liblzma, only the .xz format allows concatenated files. | * supported by liblzma, only the .xz format allows concatenated files. | |||
* Concatenated files are not allowed with the legacy .lzma format. | * Concatenated files are not allowed with the legacy .lzma format. | |||
* | * | |||
* This flag also affects the usage of the `action' argument for lzma_code( ). | * This flag also affects the usage of the `action' argument for lzma_code( ). | |||
* When LZMA_CONCATENATED is used, lzma_code() won't return LZMA_STREAM_END | * When LZMA_CONCATENATED is used, lzma_code() won't return LZMA_STREAM_END | |||
* unless LZMA_FINISH is used as `action'. Thus, the application has to set | * unless LZMA_FINISH is used as `action'. Thus, the application has to set | |||
* LZMA_FINISH in the same way as it does when encoding. | * LZMA_FINISH in the same way as it does when encoding. | |||
* | * | |||
skipping to change at line 566 | skipping to change at line 592 | |||
* the LZMA_TELL_NO_CHECK flag. | * the LZMA_TELL_NO_CHECK flag. | |||
* - LZMA_UNSUPPORTED_CHECK: This can be returned only if usin g | * - LZMA_UNSUPPORTED_CHECK: This can be returned only if usin g | |||
* the LZMA_TELL_UNSUPPORTED_CHECK flag. | * the LZMA_TELL_UNSUPPORTED_CHECK flag. | |||
* - LZMA_MEM_ERROR | * - LZMA_MEM_ERROR | |||
* - LZMA_MEMLIMIT_ERROR: Memory usage limit was reached. | * - LZMA_MEMLIMIT_ERROR: Memory usage limit was reached. | |||
* The minimum required memlimit value was stored to *memlim it. | * The minimum required memlimit value was stored to *memlim it. | |||
* - LZMA_BUF_ERROR: Output buffer was too small. | * - LZMA_BUF_ERROR: Output buffer was too small. | |||
* - LZMA_PROG_ERROR | * - LZMA_PROG_ERROR | |||
*/ | */ | |||
extern LZMA_API(lzma_ret) lzma_stream_buffer_decode( | extern LZMA_API(lzma_ret) lzma_stream_buffer_decode( | |||
uint64_t *memlimit, uint32_t flags, lzma_allocator *allocato | uint64_t *memlimit, uint32_t flags, | |||
r, | const lzma_allocator *allocator, | |||
const uint8_t *in, size_t *in_pos, size_t in_size, | const uint8_t *in, size_t *in_pos, size_t in_size, | |||
uint8_t *out, size_t *out_pos, size_t out_size) | uint8_t *out, size_t *out_pos, size_t out_size) | |||
lzma_nothrow lzma_attr_warn_unused_result; | lzma_nothrow lzma_attr_warn_unused_result; | |||
End of changes. 10 change blocks. | ||||
12 lines changed or deleted | 37 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |