| OLD | NEW |
| 1 /////////////////////////////////////////////////////////////////////////////// | 1 /////////////////////////////////////////////////////////////////////////////// |
| 2 // | 2 // |
| 3 /// \file alone_decoder.c | 3 /// \file alone_decoder.c |
| 4 /// \brief Decoder for LZMA_Alone files | 4 /// \brief Decoder for LZMA_Alone files |
| 5 // | 5 // |
| 6 // Author: Lasse Collin | 6 // Author: Lasse Collin |
| 7 // | 7 // |
| 8 // This file has been put into the public domain. | 8 // This file has been put into the public domain. |
| 9 // You can do whatever you want with this file. | 9 // You can do whatever you want with this file. |
| 10 // | 10 // |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 uint64_t memusage; | 39 uint64_t memusage; |
| 40 | 40 |
| 41 /// Options decoded from the header needed to initialize | 41 /// Options decoded from the header needed to initialize |
| 42 /// the LZMA decoder | 42 /// the LZMA decoder |
| 43 lzma_options_lzma options; | 43 lzma_options_lzma options; |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 | 46 |
| 47 static lzma_ret | 47 static lzma_ret |
| 48 alone_decode(lzma_coder *coder, | 48 alone_decode(lzma_coder *coder, |
| 49 » » lzma_allocator *allocator lzma_attribute((unused)), | 49 » » lzma_allocator *allocator lzma_attribute((__unused__)), |
| 50 const uint8_t *restrict in, size_t *restrict in_pos, | 50 const uint8_t *restrict in, size_t *restrict in_pos, |
| 51 size_t in_size, uint8_t *restrict out, | 51 size_t in_size, uint8_t *restrict out, |
| 52 size_t *restrict out_pos, size_t out_size, | 52 size_t *restrict out_pos, size_t out_size, |
| 53 lzma_action action) | 53 lzma_action action) |
| 54 { | 54 { |
| 55 while (*out_pos < out_size | 55 while (*out_pos < out_size |
| 56 && (coder->sequence == SEQ_CODE || *in_pos < in_size)) | 56 && (coder->sequence == SEQ_CODE || *in_pos < in_size)) |
| 57 switch (coder->sequence) { | 57 switch (coder->sequence) { |
| 58 case SEQ_PROPERTIES: | 58 case SEQ_PROPERTIES: |
| 59 if (lzma_lzma_lclppb_decode(&coder->options, in[*in_pos])) | 59 if (lzma_lzma_lclppb_decode(&coder->options, in[*in_pos])) |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 extern LZMA_API(lzma_ret) | 223 extern LZMA_API(lzma_ret) |
| 224 lzma_alone_decoder(lzma_stream *strm, uint64_t memlimit) | 224 lzma_alone_decoder(lzma_stream *strm, uint64_t memlimit) |
| 225 { | 225 { |
| 226 lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit); | 226 lzma_next_strm_init(lzma_alone_decoder_init, strm, memlimit); |
| 227 | 227 |
| 228 strm->internal->supported_actions[LZMA_RUN] = true; | 228 strm->internal->supported_actions[LZMA_RUN] = true; |
| 229 strm->internal->supported_actions[LZMA_FINISH] = true; | 229 strm->internal->supported_actions[LZMA_FINISH] = true; |
| 230 | 230 |
| 231 return LZMA_OK; | 231 return LZMA_OK; |
| 232 } | 232 } |
| OLD | NEW |