diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 10:05:53 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 10:05:53 +0000 |
commit | 38f9d48a0b7370eb50a55d5de4b06da954742ea9 (patch) | |
tree | b3ee914e5f53bd7eed929e2a34cdd20d7cdee3f3 /decoder.h | |
parent | Adding upstream version 1.16. (diff) | |
download | lzip-38f9d48a0b7370eb50a55d5de4b06da954742ea9.tar.xz lzip-38f9d48a0b7370eb50a55d5de4b06da954742ea9.zip |
Adding upstream version 1.17~pre1.upstream/1.17_pre1
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to '')
-rw-r--r-- | decoder.h | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -1,5 +1,5 @@ /* Lzip - LZMA lossless data compressor - Copyright (C) 2008-2014 Antonio Diaz Diaz. + Copyright (C) 2008-2015 Antonio Diaz Diaz. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,12 +19,12 @@ class Range_decoder { enum { buffer_size = 16384 }; unsigned long long partial_member_pos; - uint8_t * const buffer; // input buffer - int pos; // current pos in buffer - int stream_pos; // when reached, a new block must be read + uint8_t * const buffer; /* input buffer */ + int pos; /* current pos in buffer */ + int stream_pos; /* when reached, a new block must be read */ uint32_t code; uint32_t range; - const int infd; // input file descriptor + const int infd; /* input file descriptor */ bool at_stream_end; bool read_block(); @@ -213,23 +213,23 @@ class LZ_decoder Range_decoder & rdec; const unsigned dictionary_size; const int buffer_size; - uint8_t * const buffer; // output buffer - int pos; // current pos in buffer - int stream_pos; // first byte not yet written to file + uint8_t * const buffer; /* output buffer */ + int pos; /* current pos in buffer */ + int stream_pos; /* first byte not yet written to file */ uint32_t crc_; - const int outfd; // output file descriptor + const int outfd; /* output file descriptor */ const int member_version; void flush_data(); bool verify_trailer( const Pretty_print & pp ) const; - uint8_t get_prev_byte() const + uint8_t peek1() const { const int i = ( ( pos > 0 ) ? pos : buffer_size ) - 1; return buffer[i]; } - uint8_t get_byte( const int distance ) const + uint8_t peek( const int distance ) const { int i = pos - distance - 1; if( i < 0 ) i += buffer_size; |