annotate zlib/infcodes.c @ 3:5a977ccbc7a9 default tip

Empty changelog
author darius
date Sat, 06 Dec 1997 05:41:29 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1 /* infcodes.c -- process literals and length/distance pairs
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
2 * Copyright (C) 1995 Mark Adler
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
3 * For conditions of distribution and use, see copyright notice in zlib.h
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
4 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
5
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
6 #include "zutil.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
7 #include "inftrees.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
8 #include "infutil.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
9 #include "inffast.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
10 #include "infcodes.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
11
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
12 /* simplify the use of the inflate_huft type with some defines */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
13 #define base more.Base
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
14 #define next more.Next
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
15 #define exop word.what.Exop
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
16 #define bits word.what.Bits
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
17
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
18 /* inflate codes private state */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
19 struct inflate_codes_state {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
20
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
21 /* mode */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
22 enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
23 START, /* x: set up for LEN */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
24 LEN, /* i: get length/literal/eob next */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
25 LENEXT, /* i: getting length extra (have base) */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
26 DIST, /* i: get distance next */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
27 DISTEXT, /* i: getting distance extra */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
28 COPY, /* o: copying bytes in window, waiting for space */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
29 LIT, /* o: got literal, waiting for output space */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
30 WASH, /* o: got eob, possibly still output waiting */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
31 END, /* x: got eob and all data flushed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
32 BADCODE} /* x: got error */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
33 mode; /* current inflate_codes mode */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
34
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
35 /* mode dependent information */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
36 uInt len;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
37 union {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
38 struct {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
39 inflate_huft *tree; /* pointer into tree */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
40 uInt need; /* bits needed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
41 } code; /* if LEN or DIST, where in tree */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
42 uInt lit; /* if LIT, literal */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
43 struct {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
44 uInt get; /* bits to get for extra */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
45 uInt dist; /* distance back to copy from */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
46 } copy; /* if EXT or COPY, where and how much */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
47 } sub; /* submode */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
48
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
49 /* mode independent information */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
50 Byte lbits; /* ltree bits decoded per branch */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
51 Byte dbits; /* dtree bits decoder per branch */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
52 inflate_huft *ltree; /* literal/length/eob tree */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
53 inflate_huft *dtree; /* distance tree */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
54
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
55 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
56
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
57
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
58 struct inflate_codes_state *inflate_codes_new(bl, bd, tl, td, z)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
59 uInt bl, bd;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
60 inflate_huft *tl, *td;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
61 z_stream *z;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
62 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
63 struct inflate_codes_state *c;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
64
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
65 if ((c = (struct inflate_codes_state *)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
66 ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
67 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
68 c->mode = START;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
69 c->lbits = (Byte)bl;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
70 c->dbits = (Byte)bd;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
71 c->ltree = tl;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
72 c->dtree = td;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
73 Tracev((stderr, "inflate: codes new\n"));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
74 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
75 return c;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
76 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
77
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
78
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
79 int inflate_codes(s, z, r)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
80 struct inflate_blocks_state *s;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
81 z_stream *z;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
82 int r;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
83 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
84 uInt j; /* temporary storage */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
85 inflate_huft *t; /* temporary pointer */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
86 int e; /* extra bits or operation */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
87 uLong b; /* bit buffer */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
88 uInt k; /* bits in bit buffer */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
89 Byte *p; /* input data pointer */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
90 uInt n; /* bytes available there */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
91 Byte *q; /* output window write pointer */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
92 uInt m; /* bytes to end of window or read pointer */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
93 Byte *f; /* pointer to copy strings from */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
94 struct inflate_codes_state *c = s->sub.codes; /* codes state */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
95
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
96 /* copy input/output information to locals (UPDATE macro restores) */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
97 LOAD
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
98
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
99 /* process input and output based on current state */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
100 while (1) switch (c->mode)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
101 { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
102 case START: /* x: set up for LEN */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
103 #ifndef SLOW
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
104 if (m >= 258 && n >= 10)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
105 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
106 UPDATE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
107 r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
108 LOAD
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
109 if (r != Z_OK)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
110 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
111 c->mode = r == Z_STREAM_END ? WASH : BADCODE;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
112 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
113 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
114 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
115 #endif /* !SLOW */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
116 c->sub.code.need = c->lbits;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
117 c->sub.code.tree = c->ltree;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
118 c->mode = LEN;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
119 case LEN: /* i: get length/literal/eob next */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
120 j = c->sub.code.need;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
121 NEEDBITS(j)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
122 t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
123 DUMPBITS(t->bits)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
124 if ((e = (int)(t->exop)) < 0)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
125 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
126 if (e == -128) /* invalid code */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
127 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
128 c->mode = BADCODE;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
129 z->msg = "invalid literal/length code";
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
130 r = Z_DATA_ERROR;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
131 LEAVE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
132 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
133 e = -e;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
134 if (e & 64) /* end of block */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
135 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
136 Tracevv((stderr, "inflate: end of block\n"));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
137 c->mode = WASH;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
138 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
139 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
140 c->sub.code.need = e;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
141 c->sub.code.tree = t->next;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
142 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
143 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
144 if (e & 16) /* literal */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
145 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
146 c->sub.lit = t->base;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
147 Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
148 "inflate: literal '%c'\n" :
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
149 "inflate: literal 0x%02x\n", t->base));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
150 c->mode = LIT;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
151 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
152 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
153 c->sub.copy.get = e;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
154 c->len = t->base;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
155 c->mode = LENEXT;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
156 case LENEXT: /* i: getting length extra (have base) */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
157 j = c->sub.copy.get;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
158 NEEDBITS(j)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
159 c->len += (uInt)b & inflate_mask[j];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
160 DUMPBITS(j)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
161 c->sub.code.need = c->dbits;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
162 c->sub.code.tree = c->dtree;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
163 Tracevv((stderr, "inflate: length %u\n", c->len));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
164 c->mode = DIST;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
165 case DIST: /* i: get distance next */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
166 j = c->sub.code.need;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
167 NEEDBITS(j)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
168 t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
169 DUMPBITS(t->bits)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
170 if ((e = (int)(t->exop)) < 0)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
171 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
172 if (e == -128)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
173 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
174 c->mode = BADCODE;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
175 z->msg = "invalid distance code";
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
176 r = Z_DATA_ERROR;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
177 LEAVE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
178 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
179 c->sub.code.need = -e;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
180 c->sub.code.tree = t->next;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
181 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
182 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
183 c->sub.copy.dist = t->base;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
184 c->sub.copy.get = e;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
185 c->mode = DISTEXT;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
186 case DISTEXT: /* i: getting distance extra */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
187 j = c->sub.copy.get;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
188 NEEDBITS(j)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
189 c->sub.copy.dist += (uInt)b & inflate_mask[j];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
190 DUMPBITS(j)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
191 Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
192 c->mode = COPY;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
193 case COPY: /* o: copying bytes in window, waiting for space */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
194 f = (uInt)(q - s->window) < c->sub.copy.dist ?
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
195 s->end - (c->sub.copy.dist - (q - s->window)) :
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
196 q - c->sub.copy.dist;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
197 while (c->len)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
198 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
199 NEEDOUT
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
200 OUTBYTE(*f++)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
201 if (f == s->end)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
202 f = s->window;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
203 c->len--;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
204 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
205 c->mode = START;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
206 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
207 case LIT: /* o: got literal, waiting for output space */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
208 NEEDOUT
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
209 OUTBYTE(c->sub.lit)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
210 c->mode = START;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
211 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
212 case WASH: /* o: got eob, possibly more output */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
213 FLUSH
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
214 if (s->read != s->write)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
215 LEAVE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
216 c->mode = END;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
217 case END:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
218 r = Z_STREAM_END;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
219 LEAVE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
220 case BADCODE: /* x: got error */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
221 r = Z_DATA_ERROR;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
222 LEAVE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
223 default:
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
224 r = Z_STREAM_ERROR;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
225 LEAVE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
226 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
227 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
228
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
229
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
230 void inflate_codes_free(c, z)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
231 struct inflate_codes_state *c;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
232 z_stream *z;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
233 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
234 inflate_trees_free(c->dtree, z);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
235 inflate_trees_free(c->ltree, z);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
236 ZFREE(z, c);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
237 Tracev((stderr, "inflate: codes free\n"));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
238 }