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

Go to the source code of this file.

Functions

lzma_ret lzma_simple_props_size (uint32_t *size, const void *options)
 
lzma_ret lzma_simple_props_encode (const void *options, uint8_t *out)
 

Function Documentation

◆ lzma_simple_props_encode()

lzma_ret lzma_simple_props_encode ( const void *  options,
uint8_t out 
)

Definition at line 26 of file simple_encoder.c.

27 {
28  const lzma_options_bcj *const opt = options;
29 
30  // The default start offset is zero, so we don't need to store any
31  // options unless the start offset is non-zero.
32  if (opt == NULL || opt->start_offset == 0)
33  return LZMA_OK;
34 
35  write32le(out, opt->start_offset);
36 
37  return LZMA_OK;
38 }
const lzma_allocator const uint8_t size_t uint8_t * out
Definition: block.h:528
#define NULL
Definition: cris-opc.c:27
static const char struct stat static buf struct stat static buf static vhangup int options
Definition: sflib.h:145
Options for BCJ filters.
Definition: bcj.h:73
uint32_t start_offset
Start offset for conversions.
Definition: bcj.h:88
#define write32le(buf, num)
@ LZMA_OK
Operation completed successfully.
Definition: base.h:58

References LZMA_OK, NULL, options, out, lzma_options_bcj::start_offset, and write32le.

◆ lzma_simple_props_size()

lzma_ret lzma_simple_props_size ( uint32_t size,
const void *  options 
)

Definition at line 17 of file simple_encoder.c.

18 {
19  const lzma_options_bcj *const opt = options;
20  *size = (opt == NULL || opt->start_offset == 0) ? 0 : 4;
21  return LZMA_OK;
22 }
voidpf void uLong size
Definition: ioapi.h:138

References LZMA_OK, NULL, options, and lzma_options_bcj::start_offset.