VirtualBox

source: vbox/trunk/src/libs/liblzma-5.6.4/simple/simple_encoder.c@ 108905

Last change on this file since 108905 was 108905, checked in by vboxsync, 4 weeks ago

liblzma-5.6.4: Applied and adjusted our liblzma changes to 5.6.4. jiraref:VBP-1613

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 914 bytes
Line 
1// SPDX-License-Identifier: 0BSD
2
3///////////////////////////////////////////////////////////////////////////////
4//
5/// \file simple_encoder.c
6/// \brief Properties encoder for simple filters
7//
8// Author: Lasse Collin
9//
10///////////////////////////////////////////////////////////////////////////////
11
12#include "simple_encoder.h"
13
14
15extern lzma_ret
16lzma_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
24extern lzma_ret
25lzma_simple_props_encode(const void *options, uint8_t *out)
26{
27 const lzma_options_bcj *const opt = options;
28
29 // The default start offset is zero, so we don't need to store any
30 // options unless the start offset is non-zero.
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}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette