XZ Utils 5.4.1
Macros | Functions
index.h File Reference

Handling of Index. More...

Macros

#define UNPADDED_SIZE_MIN   LZMA_VLI_C(5)
 Minimum Unpadded Size. More...
 
#define UNPADDED_SIZE_MAX   (LZMA_VLI_MAX & ~LZMA_VLI_C(3))
 Maximum Unpadded Size. More...
 
#define INDEX_INDICATOR   0
 Index Indicator based on xz specification. More...
 

Functions

uint32_t lzma_index_padding_size (const lzma_index *i)
 
void lzma_index_prealloc (lzma_index *i, lzma_vli records)
 
static lzma_vli vli_ceil4 (lzma_vli vli)
 Round the variable-length integer to the next multiple of four. More...
 
static lzma_vli index_size_unpadded (lzma_vli count, lzma_vli index_list_size)
 Calculate the size of the Index field excluding Index Padding. More...
 
static lzma_vli index_size (lzma_vli count, lzma_vli index_list_size)
 Calculate the size of the Index field including Index Padding. More...
 
static lzma_vli index_stream_size (lzma_vli blocks_size, lzma_vli count, lzma_vli index_list_size)
 Calculate the total size of the Stream. More...
 

Detailed Description

Handling of Index.

Note
This header file does not include common.h or lzma.h because this file is needed by both liblzma internally and by the tests. Including common.h will include and define many things the tests do not need and prevents issues with header file include order. This way, if lzma.h or common.h are not included before this file it will break on every OS instead of causing more subtle errors.

Macro Definition Documentation

◆ UNPADDED_SIZE_MIN

#define UNPADDED_SIZE_MIN   LZMA_VLI_C(5)

Minimum Unpadded Size.

◆ UNPADDED_SIZE_MAX

#define UNPADDED_SIZE_MAX   (LZMA_VLI_MAX & ~LZMA_VLI_C(3))

Maximum Unpadded Size.

◆ INDEX_INDICATOR

#define INDEX_INDICATOR   0

Index Indicator based on xz specification.

Function Documentation

◆ lzma_index_padding_size()

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::index_list_size, index_size_unpadded(), LZMA_VLI_C, and lzma_index_s::record_count.

◆ lzma_index_prealloc()

void lzma_index_prealloc ( lzma_index i,
lzma_vli  records 
)

Set for how many Records to allocate memory the next time lzma_index_append() needs to allocate space for a new Record. This is used only by the Index decoder.

References lzma_index_s::prealloc, and PREALLOC_MAX.

◆ vli_ceil4()

static lzma_vli vli_ceil4 ( lzma_vli  vli)
inlinestatic

Round the variable-length integer to the next multiple of four.

Referenced by comp_blk_size(), index_size(), and lzma_block_total_size().

◆ index_size_unpadded()

static lzma_vli index_size_unpadded ( lzma_vli  count,
lzma_vli  index_list_size 
)
inlinestatic

Calculate the size of the Index field excluding Index Padding.

References lzma_vli_size().

Referenced by index_size(), lzma_index_hash_decode(), and lzma_index_padding_size().

◆ index_size()

static lzma_vli index_size ( lzma_vli  count,
lzma_vli  index_list_size 
)
inlinestatic

Calculate the size of the Index field including Index Padding.

References index_size_unpadded(), and vli_ceil4().

Referenced by index_stream_size(), lzma_index_hash_size(), lzma_index_size(), and lzma_index_stream_size().

◆ index_stream_size()

static lzma_vli index_stream_size ( lzma_vli  blocks_size,
lzma_vli  count,
lzma_vli  index_list_size 
)
inlinestatic

Calculate the total size of the Stream.

References index_size(), and LZMA_STREAM_HEADER_SIZE.