Rizin
unix-like reverse engineering framework and cli tools
lzma_stream_coder Struct Reference

Public Types

enum  {
  SEQ_STREAM_HEADER , SEQ_BLOCK_HEADER , SEQ_BLOCK , SEQ_INDEX ,
  SEQ_STREAM_FOOTER , SEQ_STREAM_PADDING
}
 
enum  {
  SEQ_STREAM_HEADER , SEQ_BLOCK_INIT , SEQ_BLOCK_HEADER , SEQ_BLOCK_ENCODE ,
  SEQ_INDEX_ENCODE , SEQ_STREAM_FOOTER
}
 

Public Attributes

enum lzma_stream_coder:: { ... }  sequence
 
lzma_next_coder block_decoder
 
lzma_block block_options
 Options for the Block encoder. More...
 
lzma_stream_flags stream_flags
 Stream Flags from Stream Header. More...
 
lzma_index_hashindex_hash
 
uint64_t memlimit
 Memory usage limit. More...
 
uint64_t memusage
 Amount of memory actually needed (only an estimate) More...
 
bool tell_no_check
 
bool tell_unsupported_check
 
bool tell_any_check
 If true, LZMA_GET_CHECK is returned after decoding Stream Header. More...
 
bool ignore_check
 
bool concatenated
 
bool first_stream
 
size_t pos
 Write position in buffer[] and position in Stream Padding. More...
 
uint8_t buffer [LZMA_BLOCK_HEADER_SIZE_MAX]
 
enum lzma_stream_coder:: { ... }  sequence
 
bool block_encoder_is_initialized
 
lzma_next_coder block_encoder
 Block. More...
 
lzma_filter filters [LZMA_FILTERS_MAX+1]
 The filter chain currently in use. More...
 
lzma_next_coder index_encoder
 
lzma_indexindex
 Index to hold sizes of the Blocks. More...
 
size_t buffer_pos
 Read position in buffer[]. More...
 
size_t buffer_size
 Total number of bytes in buffer[]. More...
 

Detailed Description

Definition at line 17 of file stream_decoder.c.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
SEQ_STREAM_HEADER 
SEQ_BLOCK_HEADER 
SEQ_BLOCK 
SEQ_INDEX 
SEQ_STREAM_FOOTER 
SEQ_STREAM_PADDING 

Definition at line 18 of file stream_decoder.c.

◆ anonymous enum

anonymous enum
Enumerator
SEQ_STREAM_HEADER 
SEQ_BLOCK_INIT 
SEQ_BLOCK_HEADER 
SEQ_BLOCK_ENCODE 
SEQ_INDEX_ENCODE 
SEQ_STREAM_FOOTER 

Definition at line 18 of file stream_encoder.c.

Member Data Documentation

◆ block_decoder

lzma_next_coder lzma_stream_coder::block_decoder

Block or Metadata decoder. This takes little memory and the same data structure can be used to decode every Block Header, so it's a good idea to have a separate lzma_next_coder structure for it.

Definition at line 30 of file stream_decoder.c.

Referenced by lzma_stream_decoder_init(), stream_decode(), and stream_decoder_end().

◆ block_encoder

lzma_next_coder lzma_stream_coder::block_encoder

◆ block_encoder_is_initialized

bool lzma_stream_coder::block_encoder_is_initialized

True if Block encoder has been initialized by stream_encoder_init() or stream_encoder_update() and thus doesn't need to be initialized in stream_encode().

Definition at line 30 of file stream_encoder.c.

Referenced by stream_encode(), and stream_encoder_update().

◆ block_options

lzma_block lzma_stream_coder::block_options

Options for the Block encoder.

Block options decoded by the Block Header decoder and used by the Block decoder.

Definition at line 34 of file stream_decoder.c.

Referenced by block_encoder_init(), stream_decode(), stream_encode(), stream_encoder_init(), and stream_encoder_update().

◆ buffer

uint8_t lzma_stream_coder::buffer

Buffer to hold Stream Header, Block Header, and Stream Footer. Block Header has biggest maximum size.

Definition at line 82 of file stream_decoder.c.

Referenced by stream_decode(), stream_encode(), and stream_encoder_init().

◆ buffer_pos

size_t lzma_stream_coder::buffer_pos

Read position in buffer[].

Definition at line 50 of file stream_encoder.c.

Referenced by stream_encode(), and stream_encoder_init().

◆ buffer_size

size_t lzma_stream_coder::buffer_size

Total number of bytes in buffer[].

Definition at line 53 of file stream_encoder.c.

Referenced by stream_encode(), and stream_encoder_init().

◆ concatenated

bool lzma_stream_coder::concatenated

If true, we will decode concatenated Streams that possibly have Stream Padding between or after them. LZMA_STREAM_END is returned once the application isn't giving us any new input, and we aren't in the middle of a Stream, and possible Stream Padding is a multiple of four bytes.

Definition at line 69 of file stream_decoder.c.

Referenced by lzma_stream_decoder_init(), and stream_decode().

◆ filters

lzma_filter lzma_stream_coder::filters[LZMA_FILTERS_MAX+1]

The filter chain currently in use.

Definition at line 39 of file stream_encoder.c.

Referenced by stream_encoder_end(), stream_encoder_init(), stream_encoder_mt_end(), stream_encoder_mt_init(), stream_encoder_update(), and worker_encode().

◆ first_stream

bool lzma_stream_coder::first_stream

When decoding concatenated Streams, this is true as long as we are decoding the first Stream. This is needed to avoid misleading LZMA_FORMAT_ERROR in case the later Streams don't have valid magic bytes.

Definition at line 75 of file stream_decoder.c.

Referenced by lzma_stream_decoder_init(), and stream_decode().

◆ ignore_check

bool lzma_stream_coder::ignore_check

If true, we will tell the Block decoder to skip calculating and verifying the integrity check.

Definition at line 62 of file stream_decoder.c.

Referenced by lzma_stream_decoder_init(), and stream_decode().

◆ index

lzma_index* lzma_stream_coder::index

Index to hold sizes of the Blocks.

Definition at line 47 of file stream_encoder.c.

Referenced by stream_encode(), stream_encode_mt(), stream_encoder_end(), stream_encoder_init(), stream_encoder_mt_end(), and stream_encoder_mt_init().

◆ index_encoder

lzma_next_coder lzma_stream_coder::index_encoder

Index encoder. This is separate from Block encoder, because this doesn't take much memory, and when encoding multiple Streams with the same encoding options we avoid reallocating memory.

Definition at line 44 of file stream_encoder.c.

Referenced by stream_encode(), stream_encode_mt(), stream_encoder_end(), stream_encoder_init(), stream_encoder_mt_end(), and stream_encoder_mt_init().

◆ index_hash

lzma_index_hash* lzma_stream_coder::index_hash

Index is hashed so that it can be compared to the sizes of Blocks with O(1) memory usage.

Definition at line 41 of file stream_decoder.c.

Referenced by lzma_stream_decoder_init(), stream_decode(), stream_decoder_end(), and stream_decoder_reset().

◆ memlimit

uint64_t lzma_stream_coder::memlimit

Memory usage limit.

Definition at line 44 of file stream_decoder.c.

Referenced by lzma_stream_decoder_init(), stream_decode(), and stream_decoder_memconfig().

◆ memusage

uint64_t lzma_stream_coder::memusage

Amount of memory actually needed (only an estimate)

Definition at line 47 of file stream_decoder.c.

Referenced by lzma_stream_decoder_init(), stream_decode(), and stream_decoder_memconfig().

◆ pos

size_t lzma_stream_coder::pos

Write position in buffer[] and position in Stream Padding.

Definition at line 78 of file stream_decoder.c.

Referenced by cmd_descs_generate.CmdDesc::_validate(), stream_decode(), and stream_decoder_reset().

◆  [1/2]

◆  [2/2]

enum { ... } lzma_stream_coder::sequence

◆ stream_flags

lzma_stream_flags lzma_stream_coder::stream_flags

◆ tell_any_check

bool lzma_stream_coder::tell_any_check

If true, LZMA_GET_CHECK is returned after decoding Stream Header.

Definition at line 58 of file stream_decoder.c.

Referenced by lzma_stream_decoder_init(), and stream_decode().

◆ tell_no_check

bool lzma_stream_coder::tell_no_check

If true, LZMA_NO_CHECK is returned if the Stream has no integrity check.

Definition at line 51 of file stream_decoder.c.

Referenced by lzma_stream_decoder_init(), and stream_decode().

◆ tell_unsupported_check

bool lzma_stream_coder::tell_unsupported_check

If true, LZMA_UNSUPPORTED_CHECK is returned if the Stream has an integrity check that isn't supported by this liblzma build.

Definition at line 55 of file stream_decoder.c.

Referenced by lzma_stream_decoder_init(), and stream_decode().


The documentation for this struct was generated from the following files: