#include "check.h"
Functions | |
LZMA_API (lzma_bool) | |
Test if the given Check ID is supported. | |
LZMA_API (uint32_t) | |
Get the size of the Check field with the given Check ID. | |
void | lzma_check_init (lzma_check_state *check, lzma_check type) |
Initialize *check depending on type. | |
void | lzma_check_update (lzma_check_state *check, lzma_check type, const uint8_t *buf, size_t size) |
Update the check state. | |
void | lzma_check_finish (lzma_check_state *check, lzma_check type) |
Finish the check calculation and store the result to check->buffer.u8. |
LZMA_API | ( | lzma_bool | ) |
Test if the given Check ID is supported.
Test if given match finder is supported.
Test if the given Filter ID is supported for encoding.
Set a compression preset to lzma_options_lzma structure.
Test if given compression mode is supported.
Compare if two Index lists are identical.
Locate a Record.
Test if the given Filter ID is supported for decoding.
Returns true if the given Check ID is supported by this liblzma build. Otherwise false is returned. It is safe to call this with a value that is not in the range [0, 15]; in that case the return value is always false.
You can assume that LZMA_CHECK_NONE and LZMA_CHECK_CRC32 are always supported (even if liblzma is built with limited features).
Returns true if the give Filter ID is supported for decoding by this liblzma build. Otherwise false is returned.
When the Index is available, it is possible to do random-access reading with granularity of Block size.
i | Pointer to lzma_index structure | |
record | Pointer to a structure to hold the search results | |
target | Uncompressed target offset which the caller would like to locate from the Stream |
If target is greater than the uncompressed size of the Stream, *record and the read position are not modified, and this function returns true.
There is no way to list which modes are available in this particular liblzma version and build. It would be useless, because a new compression mode, which the application developer wasn't aware, could require giving additional options to the encoder that the older modes don't need.
0 is the fastest and 9 is the slowest. These match the switches -0 .. -9 of the xz command line tool. In addition, it is possible to bitwise-or flags to the preset. Currently only LZMA_PRESET_EXTREME is supported. The flags are defined in container.h, because the flags are used also with lzma_easy_encoder().
The preset values are subject to changes between liblzma versions.
This function is available only if LZMA1 or LZMA2 encoder has been enabled when building liblzma.
Test if the given Check ID is supported.
Compare if two Index lists are identical.
Locate a Record.
When the Index is available, it is possible to do random-access reading with granularity of Block size.
i | Pointer to lzma_index structure | |
record | Pointer to a structure to hold the search results | |
target | Uncompressed target offset which the caller would like to locate from the Stream |
If target is greater than the uncompressed size of the Stream, *record and the read position are not modified, and this function returns true.
LZMA_API | ( | uint32_t | ) |
Get the size of the Check field with the given Check ID.
Get the number of bytes required to encode a VLI.
liblzma version number as an integer
Calculate CRC32.
Although not all Check IDs have a check algorithm associated, the size of every Check is already frozen. This function returns the size (in bytes) of the Check field with the specified Check ID. The values are: { 0, 4, 4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64, 64 }
If the argument is not in the range [0, 15], UINT32_MAX is returned.
Calculates CRC32 using the polynomial from the IEEE 802.3 standard.
buf | Pointer to the input buffer | |
size | Size of the input buffer | |
crc | Previously returned CRC value. This is used to calculate the CRC of a big buffer in smaller chunks. Set to zero when there is no previous value. |
void lzma_check_init | ( | lzma_check_state * | check, | |
lzma_check | type | |||
) |
Initialize *check depending on type.
References lzma_sha256_init(), and lzma_check_state::state.
Referenced by LZMA_API().
void lzma_check_update | ( | lzma_check_state * | check, | |
lzma_check | type, | |||
const uint8_t * | buf, | |||
size_t | size | |||
) |
Update the check state.
References lzma_sha256_update(), and lzma_check_state::state.
Referenced by hash_append(), and LZMA_API().
void lzma_check_finish | ( | lzma_check_state * | check, | |
lzma_check | type | |||
) |
Finish the check calculation and store the result to check->buffer.u8.
References lzma_check_state::buffer, lzma_sha256_finish(), lzma_check_state::state, lzma_check_state::u32, and lzma_check_state::u64.
Referenced by LZMA_API().