diff options
Diffstat (limited to 'bzlib_private.h')
-rw-r--r-- | bzlib_private.h | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/bzlib_private.h b/bzlib_private.h index 8e93480..fb51c7a 100644 --- a/bzlib_private.h +++ b/bzlib_private.h | |||
@@ -8,7 +8,7 @@ | |||
8 | This file is a part of bzip2 and/or libbzip2, a program and | 8 | This file is a part of bzip2 and/or libbzip2, a program and |
9 | library for lossless, block-sorting data compression. | 9 | library for lossless, block-sorting data compression. |
10 | 10 | ||
11 | Copyright (C) 1996-1999 Julian R Seward. All rights reserved. | 11 | Copyright (C) 1996-2000 Julian R Seward. All rights reserved. |
12 | 12 | ||
13 | Redistribution and use in source and binary forms, with or without | 13 | Redistribution and use in source and binary forms, with or without |
14 | modification, are permitted provided that the following conditions | 14 | modification, are permitted provided that the following conditions |
@@ -43,7 +43,7 @@ | |||
43 | 43 | ||
44 | Julian Seward, Cambridge, UK. | 44 | Julian Seward, Cambridge, UK. |
45 | jseward@acm.org | 45 | jseward@acm.org |
46 | bzip2/libbzip2 version 0.9.5 of 24 May 1999 | 46 | bzip2/libbzip2 version 1.0 of 21 March 2000 |
47 | 47 | ||
48 | This program is based on (at least) the work of: | 48 | This program is based on (at least) the work of: |
49 | Mike Burrows | 49 | Mike Burrows |
@@ -76,7 +76,7 @@ | |||
76 | 76 | ||
77 | /*-- General stuff. --*/ | 77 | /*-- General stuff. --*/ |
78 | 78 | ||
79 | #define BZ_VERSION "0.9.5d" | 79 | #define BZ_VERSION "1.0.1, 23-June-2000" |
80 | 80 | ||
81 | typedef char Char; | 81 | typedef char Char; |
82 | typedef unsigned char Bool; | 82 | typedef unsigned char Bool; |
@@ -94,9 +94,9 @@ typedef unsigned short UInt16; | |||
94 | #endif | 94 | #endif |
95 | 95 | ||
96 | #ifndef BZ_NO_STDIO | 96 | #ifndef BZ_NO_STDIO |
97 | extern void bz__AssertH__fail ( int errcode ); | 97 | extern void BZ2_bz__AssertH__fail ( int errcode ); |
98 | #define AssertH(cond,errcode) \ | 98 | #define AssertH(cond,errcode) \ |
99 | { if (!(cond)) bz__AssertH__fail ( errcode ); } | 99 | { if (!(cond)) BZ2_bz__AssertH__fail ( errcode ); } |
100 | #if BZ_DEBUG | 100 | #if BZ_DEBUG |
101 | #define AssertD(cond,msg) \ | 101 | #define AssertD(cond,msg) \ |
102 | { if (!(cond)) { \ | 102 | { if (!(cond)) { \ |
@@ -155,7 +155,7 @@ extern void bz_internal_error ( int errcode ); | |||
155 | 155 | ||
156 | /*-- Stuff for randomising repetitive blocks. --*/ | 156 | /*-- Stuff for randomising repetitive blocks. --*/ |
157 | 157 | ||
158 | extern Int32 rNums[512]; | 158 | extern Int32 BZ2_rNums[512]; |
159 | 159 | ||
160 | #define BZ_RAND_DECLS \ | 160 | #define BZ_RAND_DECLS \ |
161 | Int32 rNToGo; \ | 161 | Int32 rNToGo; \ |
@@ -169,7 +169,7 @@ extern Int32 rNums[512]; | |||
169 | 169 | ||
170 | #define BZ_RAND_UPD_MASK \ | 170 | #define BZ_RAND_UPD_MASK \ |
171 | if (s->rNToGo == 0) { \ | 171 | if (s->rNToGo == 0) { \ |
172 | s->rNToGo = rNums[s->rTPos]; \ | 172 | s->rNToGo = BZ2_rNums[s->rTPos]; \ |
173 | s->rTPos++; \ | 173 | s->rTPos++; \ |
174 | if (s->rTPos == 512) s->rTPos = 0; \ | 174 | if (s->rTPos == 512) s->rTPos = 0; \ |
175 | } \ | 175 | } \ |
@@ -179,7 +179,7 @@ extern Int32 rNums[512]; | |||
179 | 179 | ||
180 | /*-- Stuff for doing CRCs. --*/ | 180 | /*-- Stuff for doing CRCs. --*/ |
181 | 181 | ||
182 | extern UInt32 crc32Table[256]; | 182 | extern UInt32 BZ2_crc32Table[256]; |
183 | 183 | ||
184 | #define BZ_INITIALISE_CRC(crcVar) \ | 184 | #define BZ_INITIALISE_CRC(crcVar) \ |
185 | { \ | 185 | { \ |
@@ -194,8 +194,8 @@ extern UInt32 crc32Table[256]; | |||
194 | #define BZ_UPDATE_CRC(crcVar,cha) \ | 194 | #define BZ_UPDATE_CRC(crcVar,cha) \ |
195 | { \ | 195 | { \ |
196 | crcVar = (crcVar << 8) ^ \ | 196 | crcVar = (crcVar << 8) ^ \ |
197 | crc32Table[(crcVar >> 24) ^ \ | 197 | BZ2_crc32Table[(crcVar >> 24) ^ \ |
198 | ((UChar)cha)]; \ | 198 | ((UChar)cha)]; \ |
199 | } | 199 | } |
200 | 200 | ||
201 | 201 | ||
@@ -241,7 +241,7 @@ typedef | |||
241 | 241 | ||
242 | /* aliases for arr1 and arr2 */ | 242 | /* aliases for arr1 and arr2 */ |
243 | UInt32* ptr; | 243 | UInt32* ptr; |
244 | UInt16* block; | 244 | UChar* block; |
245 | UInt16* mtfv; | 245 | UInt16* mtfv; |
246 | UChar* zbits; | 246 | UChar* zbits; |
247 | 247 | ||
@@ -283,9 +283,11 @@ typedef | |||
283 | UChar selector [BZ_MAX_SELECTORS]; | 283 | UChar selector [BZ_MAX_SELECTORS]; |
284 | UChar selectorMtf[BZ_MAX_SELECTORS]; | 284 | UChar selectorMtf[BZ_MAX_SELECTORS]; |
285 | 285 | ||
286 | UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; | 286 | UChar len [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; |
287 | Int32 code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; | 287 | Int32 code [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; |
288 | Int32 rfreq[BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; | 288 | Int32 rfreq [BZ_N_GROUPS][BZ_MAX_ALPHA_SIZE]; |
289 | /* second dimension: only 3 needed; 4 makes index calculations faster */ | ||
290 | UInt32 len_pack[BZ_MAX_ALPHA_SIZE][4]; | ||
289 | 291 | ||
290 | } | 292 | } |
291 | EState; | 293 | EState; |
@@ -295,19 +297,19 @@ typedef | |||
295 | /*-- externs for compression. --*/ | 297 | /*-- externs for compression. --*/ |
296 | 298 | ||
297 | extern void | 299 | extern void |
298 | blockSort ( EState* ); | 300 | BZ2_blockSort ( EState* ); |
299 | 301 | ||
300 | extern void | 302 | extern void |
301 | compressBlock ( EState*, Bool ); | 303 | BZ2_compressBlock ( EState*, Bool ); |
302 | 304 | ||
303 | extern void | 305 | extern void |
304 | bsInitWrite ( EState* ); | 306 | BZ2_bsInitWrite ( EState* ); |
305 | 307 | ||
306 | extern void | 308 | extern void |
307 | hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 ); | 309 | BZ2_hbAssignCodes ( Int32*, UChar*, Int32, Int32, Int32 ); |
308 | 310 | ||
309 | extern void | 311 | extern void |
310 | hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 ); | 312 | BZ2_hbMakeCodeLengths ( UChar*, Int32*, Int32, Int32 ); |
311 | 313 | ||
312 | 314 | ||
313 | 315 | ||
@@ -493,22 +495,22 @@ typedef | |||
493 | #define GET_LL(i) \ | 495 | #define GET_LL(i) \ |
494 | (((UInt32)s->ll16[i]) | (GET_LL4(i) << 16)) | 496 | (((UInt32)s->ll16[i]) | (GET_LL4(i) << 16)) |
495 | 497 | ||
496 | #define BZ_GET_SMALL(cccc) \ | 498 | #define BZ_GET_SMALL(cccc) \ |
497 | cccc = indexIntoF ( s->tPos, s->cftab ); \ | 499 | cccc = BZ2_indexIntoF ( s->tPos, s->cftab ); \ |
498 | s->tPos = GET_LL(s->tPos); | 500 | s->tPos = GET_LL(s->tPos); |
499 | 501 | ||
500 | 502 | ||
501 | /*-- externs for decompression. --*/ | 503 | /*-- externs for decompression. --*/ |
502 | 504 | ||
503 | extern Int32 | 505 | extern Int32 |
504 | indexIntoF ( Int32, Int32* ); | 506 | BZ2_indexIntoF ( Int32, Int32* ); |
505 | 507 | ||
506 | extern Int32 | 508 | extern Int32 |
507 | decompress ( DState* ); | 509 | BZ2_decompress ( DState* ); |
508 | 510 | ||
509 | extern void | 511 | extern void |
510 | hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*, | 512 | BZ2_hbCreateDecodeTables ( Int32*, Int32*, Int32*, UChar*, |
511 | Int32, Int32, Int32 ); | 513 | Int32, Int32, Int32 ); |
512 | 514 | ||
513 | 515 | ||
514 | #endif | 516 | #endif |