Rizin
unix-like reverse engineering framework and cli tools
filter_encoder.h File Reference
#include "common.h"

Go to the source code of this file.

Functions

uint64_t lzma_mt_block_size (const lzma_filter *filters)
 
lzma_ret lzma_raw_encoder_init (lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter *filters)
 

Function Documentation

◆ lzma_mt_block_size()

uint64_t lzma_mt_block_size ( const lzma_filter filters)

Definition at line 230 of file filter_encoder.c.

231 {
232  uint64_t max = 0;
233 
234  for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i) {
235  const lzma_filter_encoder *const fe
236  = encoder_find(filters[i].id);
237  if (fe->block_size != NULL) {
238  const uint64_t size
239  = fe->block_size(filters[i].options);
240  if (size == 0)
241  return 0;
242 
243  if (size > max)
244  max = size;
245  }
246  }
247 
248  return max;
249 }
lzma_index ** i
Definition: index.h:629
const lzma_filter * filters
Definition: container.h:315
#define NULL
Definition: cris-opc.c:27
int max
Definition: enough.c:225
static const lzma_filter_encoder * encoder_find(lzma_vli id)
voidpf void uLong size
Definition: ioapi.h:138
static const char struct stat static buf struct stat static buf static vhangup int options
Definition: sflib.h:145
unsigned long uint64_t
Definition: sftypes.h:28
uint64_t(* block_size)(const void *options)
lzma_vli id
Filter ID.
Definition: filter.h:54
#define LZMA_VLI_UNKNOWN
VLI value to denote that the value is unknown.
Definition: vli.h:39

References lzma_filter_encoder::block_size, encoder_find(), filters, i, lzma_filter::id, LZMA_VLI_UNKNOWN, max, NULL, and options.

Referenced by get_options().

◆ lzma_raw_encoder_init()

lzma_ret lzma_raw_encoder_init ( lzma_next_coder next,
const lzma_allocator allocator,
const lzma_filter filters 
)

Definition at line 199 of file filter_encoder.c.

201 {
202  return lzma_raw_coder_init(next, allocator,
204 }
const lzma_allocator * allocator
Definition: block.h:377
lzma_ret lzma_raw_coder_init(lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter *options, lzma_filter_find coder_find, bool is_encoder)
const lzma_filter_coder *(* lzma_filter_find)(lzma_vli id)
Definition: filter_common.h:35

References allocator, encoder_find(), lzma_raw_coder_init(), and options.

Referenced by block_encode_normal(), LZMA_API(), and lzma_block_encoder_init().