2
* inflate.h - inflate decompression routine
8
* Copyright (c) 1995, Edward B. Hamrick
10
* Permission to use, copy, modify, distribute, and sell this software and
11
* its documentation for any purpose is hereby granted without fee, provided
14
* (i) the above copyright notice and the text in this "C" comment block
15
* appear in all copies of the software and related documentation, and
17
* (ii) any modifications to this source file must be sent, via e-mail
18
* to the copyright owner (currently hamrick@primenet.com) within
19
* 30 days of such modification.
21
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
22
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
23
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
25
* IN NO EVENT SHALL EDWARD B. HAMRICK BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
26
* INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
27
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
28
* THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF
29
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
33
* 1) All file i/o is done externally to these routines
34
* 2) Routines are symmetrical so inflate can feed into deflate
35
* 3) Routines can be easily integrated into wide range of applications
36
* 4) Routines are very portable, and use only ANSI C
37
* 5) No #defines in inflate.h to conflict with external #defines
38
* 6) No external routines need be called by these routines
39
* 7) Buffers are owned by the calling routine
40
* 8) No static non-constant variables are allowed
44
* Note that for each call to InflatePutBuffer, there will be
45
* 0 or more calls to (*putbuffer_ptr). All except the last
46
* call to (*putbuffer_ptr) will be with 32768 bytes, although
47
* this behaviour may change in the future. Before InflatePutBuffer
48
* returns, it will have output as much uncompressed data as
59
/* Routine to initialize inflate decompression */
60
void *InflateInitialize( /* returns InflateState */
61
void *AppState, /* for passing to putbuffer */
62
int (*putbuffer_ptr)( /* returns 0 on success */
63
void *AppState, /* opaque ptr from Initialize */
64
unsigned char *buffer, /* buffer to put */
65
long length /* length of buffer */
67
void *(*malloc_ptr)(long length), /* utility routine */
68
void (*free_ptr)(void *buffer) /* utility routine */
71
/* Call-in routine to put a buffer into inflate decompression */
72
int InflatePutBuffer( /* returns 0 on success */
73
void *InflateState, /* opaque ptr from Initialize */
74
unsigned char *buffer, /* buffer to put */
75
long length /* length of buffer */
78
/* Routine to terminate inflate decompression */
79
int InflateTerminate( /* returns 0 on success */
80
void *InflateState /* opaque ptr from Initialize */