summaryrefslogtreecommitdiffstats
path: root/lzip.h
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 13:33:37 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 13:33:37 +0000
commitab966f56fd3eb037f32e6d804c4a32cc12d85162 (patch)
tree890d1aa577cb9559554944e079160e37074ba47c /lzip.h
parentAdding debian version 0.3-2. (diff)
downloadlzlib-ab966f56fd3eb037f32e6d804c4a32cc12d85162.tar.xz
lzlib-ab966f56fd3eb037f32e6d804c4a32cc12d85162.zip
Merging upstream version 0.4.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'lzip.h')
-rw-r--r--lzip.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/lzip.h b/lzip.h
index a568988..cf8e56e 100644
--- a/lzip.h
+++ b/lzip.h
@@ -121,16 +121,21 @@ public:
uint32_t operator[]( const uint8_t byte ) const throw() { return data[byte]; }
void update( uint32_t & crc, const uint8_t byte ) const throw()
{ crc = data[(crc^byte)&0xFF] ^ ( crc >> 8 ); }
+ void update( uint32_t & crc, const uint8_t * const buffer, const int size ) const throw()
+ {
+ for( int i = 0; i < size; ++i )
+ crc = data[(crc^buffer[i])&0xFF] ^ ( crc >> 8 );
+ }
};
extern const CRC32 crc32;
-const char * const magic_string = "LZIP";
+const uint8_t magic_string[4] = { 'L', 'Z', 'I', 'P' };
struct File_header
{
- char magic[4];
+ uint8_t magic[4];
uint8_t version;
uint8_t coded_dict_size;