summaryrefslogtreecommitdiffstats
path: root/lzip.h
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 07:23:00 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 07:23:00 +0000
commit7cad15d85d55c7ad11cb25c2ec5e8cd17ecc84ee (patch)
treec998e3ce491834f84eb9b733c757d83efed25842 /lzip.h
parentAdding upstream version 1.6~pre1. (diff)
downloadlzip-7cad15d85d55c7ad11cb25c2ec5e8cd17ecc84ee.tar.xz
lzip-7cad15d85d55c7ad11cb25c2ec5e8cd17ecc84ee.zip
Adding upstream version 1.6~pre2.upstream/1.6_pre2
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 89afe96..a50941f 100644
--- a/lzip.h
+++ b/lzip.h
@@ -150,14 +150,19 @@ 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 );
+ }
};
-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;