12 " inflate9 1.2.13 Copyright 1995-2022 Mark Adler ";
34 unsigned short FAR *lens;
38 unsigned short FAR *work;
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};
111 for (sym = 0; sym <
codes; sym++)
119 if (
max == 0)
return -1;
129 if (left < 0)
return -1;
140 for (sym = 0; sym <
codes; sym++)
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);
235 incr = 1U << (
len - 1);
249 len = lens[work[sym]];
253 if (
len >
root && (huff & mask) != low) {
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);