12 " inflate9 1.2.13 Copyright 1995-2022 Mark Adler ";
34unsigned short FAR *lens;
38unsigned short FAR *work;
55 const unsigned short FAR *base;
56 const unsigned short FAR *extra;
60 static const unsigned short lbase[31] = {
61 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17,
62 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115,
63 131, 163, 195, 227, 3, 0, 0};
64 static const unsigned short lext[31] = {
65 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
66 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
67 133, 133, 133, 133, 144, 194, 65};
68 static const unsigned short dbase[32] = {
69 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
70 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
71 4097, 6145, 8193, 12289, 16385, 24577, 32769, 49153};
72 static const unsigned short dext[32] = {
73 128, 128, 128, 128, 129, 129, 130, 130, 131, 131, 132, 132,
74 133, 133, 134, 134, 135, 135, 136, 136, 137, 137, 138, 138,
75 139, 139, 140, 140, 141, 141, 142, 142};
119 if (
max == 0)
return -1;
120 for (min = 1; min <=
MAXBITS; min++)
121 if (
count[min] != 0)
break;
129 if (left < 0)
return -1;
131 if (left > 0 && (type ==
CODES ||
max != 1))
141 if (lens[
sym] != 0) work[offs[lens[
sym]]++] = (
unsigned short)
sym;
200 low = (unsigned)(-1);
212 this.
bits = (
unsigned char)(
len - drop);
213 if ((
int)(work[
sym]) < end) {
214 this.op = (
unsigned char)0;
215 this.val = work[
sym];
217 else if ((
int)(work[
sym]) > end) {
218 this.op = (
unsigned char)(extra[work[
sym]]);
219 this.val = base[work[
sym]];
222 this.op = (
unsigned char)(32 + 64);
227 incr = 1U << (
len - drop);
231 next[(huff >> drop) + fill] =
this;
235 incr = 1U << (
len - 1);
263 left = (
int)(1 << curr);
264 while (curr + drop <
max) {
265 left -=
count[curr + drop];
266 if (left <= 0)
break;
279 (*table)[low].op = (
unsigned char)curr;
280 (*table)[low].bits = (
unsigned char)
root;
281 (*table)[low].val = (
unsigned short)(next - *table);
292 this.op = (
unsigned char)64;
293 this.
bits = (
unsigned char)(
len - drop);
294 this.val = (
unsigned short)0;
297 if (drop != 0 && (huff &
mask) != low) {
302 this.
bits = (
unsigned char)
len;
306 next[huff >> drop] =
this;
309 incr = 1U << (
len - 1);
int bits(struct state *s, int need)
const char inflate9_copyright[]
int inflate_table9(codetype type, unsigned short FAR *lens, unsigned codes, code FAR *FAR *table, unsigned FAR *bits, unsigned short FAR *work)
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
int codes(struct state *s, const struct huffman *lencode, const struct huffman *distcode)