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

Delta filter decoder. More...

#include "delta_common.h"

Go to the source code of this file.

Functions

lzma_ret lzma_delta_decoder_init (lzma_next_coder *next, const lzma_allocator *allocator, const lzma_filter_info *filters)
 
lzma_ret lzma_delta_props_decode (void **options, const lzma_allocator *allocator, const uint8_t *props, size_t props_size)
 

Detailed Description

Delta filter decoder.

Definition in file delta_decoder.h.

Function Documentation

◆ lzma_delta_decoder_init()

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

Definition at line 52 of file delta_decoder.c.

54 {
55  next->code = &delta_decode;
57 }
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_decode(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_decoder.c:30
lzma_code_function code
Pointer to function to do the actual coding.
Definition: common.h:150

References allocator, lzma_next_coder_s::code, delta_decode(), filters, and lzma_delta_coder_init().

◆ lzma_delta_props_decode()

lzma_ret lzma_delta_props_decode ( void **  options,
const lzma_allocator allocator,
const uint8_t props,
size_t  props_size 
)

Definition at line 61 of file delta_decoder.c.

63 {
64  if (props_size != 1)
65  return LZMA_OPTIONS_ERROR;
66 
69  if (opt == NULL)
70  return LZMA_MEM_ERROR;
71 
73  opt->dist = props[0] + 1U;
74 
75  *options = opt;
76 
77  return LZMA_OK;
78 }
#define NULL
Definition: cris-opc.c:27
@ LZMA_DELTA_TYPE_BYTE
Definition: delta.h:36
const lzma_allocator const uint8_t * props
Definition: filter.h:362
static const char struct stat static buf struct stat static buf static vhangup int options
Definition: sflib.h:145
Options for the Delta filter.
Definition: delta.h:45
uint32_t dist
Delta distance.
Definition: delta.h:59
lzma_delta_type type
Definition: delta.h:47
void * lzma_alloc(size_t size, const lzma_allocator *allocator) lzma_attribute((__malloc__)) lzma_attr_alloc_size(1)
Allocates memory.
@ LZMA_MEM_ERROR
Cannot allocate memory.
Definition: base.h:128
@ LZMA_OPTIONS_ERROR
Invalid or unsupported options.
Definition: base.h:160
@ LZMA_OK
Operation completed successfully.
Definition: base.h:58

References allocator, lzma_options_delta::dist, lzma_alloc(), LZMA_DELTA_TYPE_BYTE, LZMA_MEM_ERROR, LZMA_OK, LZMA_OPTIONS_ERROR, NULL, options, props, and lzma_options_delta::type.