infutil.h revision ada1678a4262b208a7b87391f520a7767d25287c
/* infutil.h -- types and macros common to blocks and codes
* Copyright (C) 1995-2002 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h.
*/
#ifndef _INFUTIL_H
#define _INFUTIL_H
typedef enum {
TYPE, /* get type bits (3, including end bit) */
LENS, /* get lengths for stored */
STORED, /* processing stored block */
TABLE, /* get table lengths */
BTREE, /* get bit lengths tree for a dynamic block */
DTREE, /* get length, distance trees for a dynamic block */
CODES, /* processing fixed or dynamic block */
DRY, /* output remaining window bytes */
DONE, /* finished last block, done */
BAD} /* got a data error--stuck here */
/* inflate blocks semi-private state */
struct inflate_blocks_state {
/* mode */
/* mode dependent information */
union {
struct {
} trees; /* if DTREE, decoding info for trees */
struct {
*codes;
} decode; /* if CODES, current state */
} sub; /* submode */
/* mode independent information */
};
/* update pointers and return */
/* get bytes and bits */
#define NEXTBYTE (n--,*p++)
#define DUMPBITS(j) {b>>=(j);k-=(j);}
/* output bytes */
/* load local pointers */
/* masks for lower bits (size given to avoid silly warnings with Visual C++) */
/* copy as much as possible from the sliding window to the output area */
extern int inflate_flush OF((
int));
#endif