3 { infcodes.c -- process literals and length/distance pairs
4 Copyright (C) 1995-1998 Mark Adler
6 Pascal tranlastion
7 Copyright (C) 1998 by Jacques Nomssi Nzali
8 For conditions of distribution and use, see copyright notice in readme.txt
9 }
11 interface
13 {$I imzconf.inc}
15 uses
16 {$IFDEF DEBUG}
18 {$ENDIF}
34 implementation
36 uses
45 var
47 begin
50 begin
56 {$IFDEF DEBUG}
58 {$ENDIF}
67 var
78 var
80 begin
83 { copy input/output information to locals }
91 else
94 { process input and output based on current state }
97 { waiting for "i:"=input, "o:"=output, "x:"=nothing }
99 begin
100 {$ifndef SLOW}
102 begin
103 {UPDATE}
112 {LOAD}
120 else
124 begin
127 else
138 begin
140 {NEEDBITS(j);}
142 begin
143 {NEEDBYTE;}
145 r :=Z_OK
146 else
147 begin
148 {UPDATE}
156 exit;
165 {DUMPBITS(t^.bits);}
171 begin
173 {$IFDEF DEBUG}
176 else
178 {$ENDIF}
183 begin
190 begin
196 begin
197 {$IFDEF DEBUG}
199 {$ENDIF}
206 {UPDATE}
214 exit;
217 begin
219 {NEEDBITS(j);}
221 begin
222 {NEEDBYTE;}
224 r :=Z_OK
225 else
226 begin
227 {UPDATE}
235 exit;
243 {DUMPBITS(j);}
249 {$IFDEF DEBUG}
251 {$ENDIF}
253 { falltrough }
256 begin
258 {NEEDBITS(j);}
260 begin
261 {NEEDBYTE;}
263 r :=Z_OK
264 else
265 begin
266 {UPDATE}
274 exit;
282 {DUMPBITS(t^.bits);}
288 begin
295 begin
303 {UPDATE}
311 exit;
314 begin
316 {NEEDBITS(j);}
318 begin
319 {NEEDBYTE;}
321 r :=Z_OK
322 else
323 begin
324 {UPDATE}
332 exit;
340 {DUMPBITS(j);}
343 {$IFDEF DEBUG}
345 {$ENDIF}
347 { falltrough }
350 begin
354 begin
360 begin
361 {NEEDOUT}
363 begin
364 {WRAP}
366 begin
370 else
375 begin
376 {FLUSH}
382 else
385 {WRAP}
387 begin
391 else
396 begin
397 {UPDATE}
405 exit;
411 {OUTBYTE( *f++)}
422 { C-switch break; not needed }
425 begin
426 {NEEDOUT}
428 begin
429 {WRAP}
431 begin
435 else
440 begin
441 {FLUSH}
447 else
450 {WRAP}
452 begin
456 else
461 begin
462 {UPDATE}
470 exit;
476 {OUTBYTE(c^.sub.lit);}
482 {break;}
485 begin
486 {$ifdef patch112}
488 begin
489 {$IFDEF DEBUG}
491 {$ENDIF}
496 {$endif}
497 {FLUSH}
503 else
507 begin
508 {UPDATE}
516 exit;
519 { falltrough }
522 ZEND:
523 begin
525 {UPDATE}
533 exit;
536 begin
538 {UPDATE}
546 exit;
548 else
549 begin
551 {UPDATE}
559 exit;
562 {NEED_DUMMY_RETURN - Delphi2+ dumb compilers complain without this }
569 begin
571 {$IFDEF DEBUG}
573 {$ENDIF}