OLD | NEW |
1 /* infback.c -- inflate using a call-back interface | 1 /* infback.c -- inflate using a call-back interface |
2 * Copyright (C) 1995-2011 Mark Adler | 2 * Copyright (C) 1995-2016 Mark Adler |
3 * For conditions of distribution and use, see copyright notice in zlib.h | 3 * For conditions of distribution and use, see copyright notice in zlib.h |
4 */ | 4 */ |
5 | 5 |
6 /* | 6 /* |
7 This code is largely copied from inflate.c. Normally either infback.o or | 7 This code is largely copied from inflate.c. Normally either infback.o or |
8 inflate.o would be linked into an application--not both. The interface | 8 inflate.o would be linked into an application--not both. The interface |
9 with inffast.c is retained so that optimized assembler-coded versions of | 9 with inffast.c is retained so that optimized assembler-coded versions of |
10 inflate_fast() can be used with either inflate.c or infback.c. | 10 inflate_fast() can be used with either inflate.c or infback.c. |
11 */ | 11 */ |
12 | 12 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 return Z_STREAM_ERROR; | 54 return Z_STREAM_ERROR; |
55 #else | 55 #else |
56 strm->zfree = zcfree; | 56 strm->zfree = zcfree; |
57 #endif | 57 #endif |
58 state = (struct inflate_state FAR *)ZALLOC(strm, 1, | 58 state = (struct inflate_state FAR *)ZALLOC(strm, 1, |
59 sizeof(struct inflate_state)); | 59 sizeof(struct inflate_state)); |
60 if (state == Z_NULL) return Z_MEM_ERROR; | 60 if (state == Z_NULL) return Z_MEM_ERROR; |
61 Tracev((stderr, "inflate: allocated\n")); | 61 Tracev((stderr, "inflate: allocated\n")); |
62 strm->state = (struct internal_state FAR *)state; | 62 strm->state = (struct internal_state FAR *)state; |
63 state->dmax = 32768U; | 63 state->dmax = 32768U; |
64 state->wbits = windowBits; | 64 state->wbits = (uInt)windowBits; |
65 state->wsize = 1U << windowBits; | 65 state->wsize = 1U << windowBits; |
66 state->window = window; | 66 state->window = window; |
67 state->wnext = 0; | 67 state->wnext = 0; |
68 state->whave = 0; | 68 state->whave = 0; |
69 return Z_OK; | 69 return Z_OK; |
70 } | 70 } |
71 | 71 |
72 /* | 72 /* |
73 Return state with length and distance decoding tables and index sizes set to | 73 Return state with length and distance decoding tables and index sizes set to |
74 fixed code decoding. Normally this returns fixed tables from inffixed.h. | 74 fixed code decoding. Normally this returns fixed tables from inffixed.h. |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 int ZEXPORT inflateBackEnd(strm) | 631 int ZEXPORT inflateBackEnd(strm) |
632 z_streamp strm; | 632 z_streamp strm; |
633 { | 633 { |
634 if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) | 634 if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) |
635 return Z_STREAM_ERROR; | 635 return Z_STREAM_ERROR; |
636 ZFREE(strm, strm->state); | 636 ZFREE(strm, strm->state); |
637 strm->state = Z_NULL; | 637 strm->state = Z_NULL; |
638 Tracev((stderr, "inflate: end\n")); | 638 Tracev((stderr, "inflate: end\n")); |
639 return Z_OK; | 639 return Z_OK; |
640 } | 640 } |
OLD | NEW |