#ifndef _ZLIB_H_
#define _ZLIB_H_
#include <ultra64.h>

extern u8 *rz_inbuf;
extern u8 *rz_outbuf;
extern u32 rz_inptr;
extern u32 rz_wp;
extern struct huft *rz_hlist;

/* Huffman code lookup table entry--this entry is four bytes for machines
   that have 16-bit pointers (e.g. PC's in the small or medium model).
   Valid extra bits are 0..13.  e == 15 is EOB (end of block), e == 16
   means that v is a literal, 16 < e < 32 means that v is a pointer to
   the next table, which codes e - 16 bits, and lastly e == 99 indicates
   an unused code.  If a code with e == 99 is looked up, this implies an
   error in the data. */
// from gzip 1.2.4 inflate.c (public domain)
struct huft {
	u8 e;                /* number of extra bits or operation */
	u8 b;                /* number of bits in this code or subcode */
	union {
		u16 n;            /* literal, length base, or distance base */
		struct huft *t;   /* pointer to next level of table */
	} v;
};
#endif
