/*1* inflate.h - inflate decompression routine2*3* Version 1.1.24*/56/*7* Copyright (C) 1995, Edward B. Hamrick8*9* Permission to use, copy, modify, and distribute this software and10* its documentation for any purpose and without fee is hereby granted,11* provided that the above copyright notice appear in all copies and12* that both that copyright notice and this permission notice appear in13* supporting documentation, and that the name of the copyright holders14* not be used in advertising or publicity pertaining to distribution of15* the software without specific, written prior permission. The copyright16* holders makes no representations about the suitability of this software17* for any purpose. It is provided "as is" without express or implied warranty.18*19* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS20* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,21* IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT22* OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF23* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER24* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE25* OF THIS SOFTWARE.26*/2728/*29* Changes from 1.1 to 1.1.2:30* Relicensed under the MIT license, with consent of the copyright holders.31* Claudio Matsuoka (Jan 11 2011)32*/3334/*35* 1) All file i/o is done externally to these routines36* 2) Routines are symmetrical so inflate can feed into deflate37* 3) Routines can be easily integrated into wide range of applications38* 4) Routines are very portable, and use only ANSI C39* 5) No #defines in inflate.h to conflict with external #defines40* 6) No external routines need be called by these routines41* 7) Buffers are owned by the calling routine42* 8) No static non-constant variables are allowed43*/4445/*46* Note that for each call to InflatePutBuffer, there will be47* 0 or more calls to (*putbuffer_ptr). All except the last48* call to (*putbuffer_ptr) will be with 32768 bytes, although49* this behaviour may change in the future. Before InflatePutBuffer50* returns, it will have output as much uncompressed data as51* is possible.52*/5354#ifndef __INFLATE_H55#define __INFLATE_H5657#ifdef __cplusplus58extern "C" {59#endif6061/* Routine to initialize inflate decompression */62void *InflateInitialize( /* returns InflateState */63void *AppState, /* for passing to putbuffer */64int (*putbuffer_ptr)( /* returns 0 on success */65void *AppState, /* opaque ptr from Initialize */66unsigned char *buffer, /* buffer to put */67long length /* length of buffer */68),69void *(*malloc_ptr)(long length), /* utility routine */70void (*free_ptr)(void *buffer) /* utility routine */71);7273/* Call-in routine to put a buffer into inflate decompression */74int InflatePutBuffer( /* returns 0 on success */75void *InflateState, /* opaque ptr from Initialize */76unsigned char *buffer, /* buffer to put */77long length /* length of buffer */78);7980/* Routine to terminate inflate decompression */81int InflateTerminate( /* returns 0 on success */82void *InflateState /* opaque ptr from Initialize */83);8485#ifdef __cplusplus86}87#endif8889#endif909192