Rizin
unix-like reverse engineering framework and cli tools
delta_encoder.h File Reference

Delta filter encoder. More...

#include "delta_common.h"

Go to the source code of this file.

Functions

lzma_ret lzma_delta_encoder_init (lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter_info *filters)
 
lzma_ret lzma_delta_props_encode (const void *options, uint8_t *out)
 

Detailed Description

Delta filter encoder.

Definition in file delta_encoder.h.

Function Documentation

◆ lzma_delta_encoder_init()

lzma_ret lzma_delta_encoder_init ( lzma_next_coder next,
const lzma_allocator allocator,
const lzma_filter_info filters 
)

Definition at line 104 of file delta_encoder.c.

106 {
107  next->code = &delta_encode;
108  next->update = &delta_encoder_update;
109  return lzma_delta_coder_init(next, allocator, filters);
110 }
const lzma_allocator * allocator
Definition: block.h:377
const lzma_filter * filters
Definition: container.h:315
lzma_ret lzma_delta_coder_init(lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter_info *filters)
Definition: delta_common.c:28
static lzma_ret delta_encode(void *coder_ptr, const lzma_allocator *allocator, const uint8_t *restrict in, size_t *restrict in_pos, size_t in_size, uint8_t *restrict out, size_t *restrict out_pos, size_t out_size, lzma_action action)
Definition: delta_encoder.c:52
static lzma_ret delta_encoder_update(void *coder_ptr, const lzma_allocator *allocator, const lzma_filter *filters_null lzma_attribute((__unused__)), const lzma_filter *reversed_filters)
Definition: delta_encoder.c:89
lzma_code_function code
Pointer to function to do the actual coding.
Definition: common.h:150
lzma_ret(* update)(void *coder, const lzma_allocator *allocator, const lzma_filter *filters, const lzma_filter *reversed_filters)
Definition: common.h:173

References allocator, lzma_next_coder_s::code, delta_encode(), delta_encoder_update(), filters, lzma_delta_coder_init(), and lzma_next_coder_s::update.

◆ lzma_delta_props_encode()

lzma_ret lzma_delta_props_encode ( const void *  options,
uint8_t out 
)

Definition at line 114 of file delta_encoder.c.

115 {
116  // The caller must have already validated the options, so it's
117  // LZMA_PROG_ERROR if they are invalid.
119  return LZMA_PROG_ERROR;
120 
121  const lzma_options_delta *opt = options;
122  out[0] = opt->dist - LZMA_DELTA_DIST_MIN;
123 
124  return LZMA_OK;
125 }
const lzma_allocator const uint8_t size_t uint8_t * out
Definition: block.h:528
#define LZMA_DELTA_DIST_MIN
Definition: delta.h:60
uint64_t lzma_delta_coder_memusage(const void *options)
Definition: delta_common.c:63
static const char struct stat static buf struct stat static buf static vhangup int options
Definition: sflib.h:145
#define UINT64_MAX
Options for the Delta filter.
Definition: delta.h:45
uint32_t dist
Delta distance.
Definition: delta.h:59
@ LZMA_PROG_ERROR
Programming error.
Definition: base.h:218
@ LZMA_OK
Operation completed successfully.
Definition: base.h:58

References lzma_options_delta::dist, lzma_delta_coder_memusage(), LZMA_DELTA_DIST_MIN, LZMA_OK, LZMA_PROG_ERROR, options, out, and UINT64_MAX.