Handling of Index. More...
#include "index.h"
Data Structures | |
struct | lzma_index_group_s |
struct | lzma_index_s |
Defines | |
#define | INDEX_GROUP_SIZE 256 |
Number of Records to allocate at once in the unrolled list. | |
Typedefs | |
typedef struct lzma_index_group_s | lzma_index_group |
Functions | |
LZMA_API (lzma_vli) | |
Calculate rough memory usage of easy encoder. | |
static void | free_index_list (lzma_index *i, lzma_allocator *allocator) |
LZMA_API (lzma_index *) | |
LZMA_API (void) | |
Free memory allocated for the coder data structures. | |
uint32_t | lzma_index_padding_size (const lzma_index *i) |
static lzma_ret | index_append_real (lzma_index *i, lzma_allocator *allocator, lzma_vli unpadded_size, lzma_vli uncompressed_size, bool is_padding) |
LZMA_API (lzma_ret) | |
static bool | init_current (lzma_index *i) |
Initialize i->current to point to the first Record. | |
static void | previous_group (lzma_index *i) |
Go backward to the previous group. | |
static void | next_group (lzma_index *i) |
Go forward to the next group. | |
static void | set_info (const lzma_index *i, lzma_index_record *info) |
Set *info from i->current. | |
LZMA_API (lzma_bool) |
Handling of Index.
#define INDEX_GROUP_SIZE 256 |
Number of Records to allocate at once in the unrolled list.
Referenced by index_append_real().
LZMA_API | ( | uint64_t | ) |
Calculate rough memory usage of easy encoder.
Calculate memory usage for Index with given number of Records.
Calculate rough decoder memory usage of a preset.
This function is a wrapper for lzma_raw_encoder_memusage().
preset | Compression preset (level and possible flags) |
This function is a wrapper for lzma_raw_decoder_memusage().
preset | Compression preset (level and possible flags) |
LZMA_API | ( | void | ) |
Free memory allocated for the coder data structures.
Rewind the Index.
strm | Pointer to lzma_stream that is at least initialized with LZMA_STREAM_INIT. |
After lzma_end(strm), strm->internal is guaranteed to be NULL. No other members of the lzma_stream structure are touched.
Rewind the Index so that next call to lzma_index_read() will return the first Record.
Free memory allocated for the coder data structures.
Rewind the Index.
If i is NULL, this does nothing.
Rewind the Index so that next call to lzma_index_read() will return the first Record.
uint32_t lzma_index_padding_size | ( | const lzma_index * | i | ) |
Get the size of the Index Padding field. This is needed by Index encoder and decoder, but applications should have no use for this.
References lzma_index_s::count, lzma_index_s::index_list_size, and LZMA_VLI_C.
static lzma_ret index_append_real | ( | lzma_index * | i, | |
lzma_allocator * | allocator, | |||
lzma_vli | unpadded_size, | |||
lzma_vli | uncompressed_size, | |||
bool | is_padding | |||
) | [static] |
Appends a new Record to the Index. If needed, this allocates a new Record group.
References lzma_index_s::head, INDEX_GROUP_SIZE, lzma_index_group_s::last, lzma_alloc(), LZMA_MEM_ERROR, LZMA_OK, lzma_index_group_s::next, lzma_index_group_s::paddings, lzma_index_group_s::prev, lzma_index_s::tail, lzma_index_group_s::uncompressed_sums, and lzma_index_group_s::unpadded_sums.
static bool init_current | ( | lzma_index * | i | ) | [static] |
Initialize i->current to point to the first Record.
References lzma_index_s::count, lzma_index_s::current, lzma_index_s::group, lzma_index_s::head, LZMA_STREAM_HEADER_SIZE, lzma_index_s::record, lzma_index_s::stream_offset, and lzma_index_s::uncompressed_offset.
Referenced by LZMA_API().
static void previous_group | ( | lzma_index * | i | ) | [static] |
Go backward to the previous group.
References lzma_index_s::current, lzma_index_s::group, lzma_index_group_s::last, lzma_index_group_s::prev, lzma_index_s::record, lzma_index_s::stream_offset, lzma_index_s::uncompressed_offset, lzma_index_group_s::uncompressed_sums, and lzma_index_group_s::unpadded_sums.
Referenced by LZMA_API().
static void next_group | ( | lzma_index * | i | ) | [static] |
Go forward to the next group.
References lzma_index_s::current, lzma_index_s::group, lzma_index_group_s::last, lzma_index_group_s::next, lzma_index_s::record, lzma_index_s::stream_offset, lzma_index_s::uncompressed_offset, lzma_index_group_s::uncompressed_sums, and lzma_index_group_s::unpadded_sums.
Referenced by LZMA_API().
static void set_info | ( | const lzma_index * | i, | |
lzma_index_record * | info | |||
) | [static] |
Set *info from i->current.
References lzma_index_s::current, lzma_index_s::group, lzma_index_s::record, lzma_index_s::stream_offset, lzma_index_record::stream_offset, lzma_index_record::total_size, lzma_index_s::uncompressed_offset, lzma_index_record::uncompressed_offset, lzma_index_record::uncompressed_size, lzma_index_group_s::uncompressed_sums, lzma_index_record::unpadded_size, and lzma_index_group_s::unpadded_sums.
Referenced by LZMA_API().