index.h File Reference

Handling of Index. More...

`#include "common.h"`

## 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...

## 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.

## 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.

## 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 INDEX_GROUP_SIZE, lzma_index_s::prealloc, and PREALLOC_MAX.

## vli_ceil4()

static lzma_vli vli_ceil4 | ( | lzma_vli | vli | ) |

inline static

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

Referenced by index_size(), and lzma_block_total_size().

## index_size_unpadded()

static lzma_vli index_size_unpadded | ( | lzma_vli | count,
|  | lzma_vli | index_list_size
| ) |  |

inline static

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
| ) |  |

inline static

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
| ) |  |

inline static

Calculate the total size of the Stream.

References index_size(), and LZMA_STREAM_HEADER_SIZE.