| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
#include "simple_encoder.h" |
| 13 |
|
| 14 |
|
| 15 |
extern lzma_ret |
| 16 |
lzma_simple_props_size(uint32_t *size, const void *options) |
| 17 |
{ |
| 18 |
const lzma_options_bcj *const opt = options; |
| 19 |
*size = (opt == NULL || opt->start_offset == 0) ? 0 : 4; |
| 20 |
return LZMA_OK; |
| 21 |
} |
| 22 |
|
| 23 |
|
| 24 |
extern lzma_ret |
| 25 |
lzma_simple_props_encode(const void *options, uint8_t *out) |
| 26 |
{ |
| 27 |
const lzma_options_bcj *const opt = options; |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
if (opt == NULL || opt->start_offset == 0) |
| 32 |
return LZMA_OK; |
| 33 |
|
| 34 |
write32le(out, opt->start_offset); |
| 35 |
|
| 36 |
return LZMA_OK; |
| 37 |
} |