1139825Simp/*-
23417Scsgr * ----------------------------------------------------------------------------
33417Scsgr * "THE BEER-WARE LICENSE" (Revision 42):
493195Sphk * <phk@FreeBSD.org> wrote this file.  As long as you retain this notice you
53417Scsgr * can do whatever you want with this stuff. If we meet some day, and you think
63417Scsgr * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
73417Scsgr * ----------------------------------------------------------------------------
83417Scsgr *
950477Speter * $FreeBSD$
103417Scsgr *
113417Scsgr */
123784Sphk#ifndef	_SYS_INFLATE_H_
133784Sphk#define	_SYS_INFLATE_H_
143417Scsgr
1555205Speter#if defined(_KERNEL) || defined(KZIP)
163417Scsgr
173784Sphk#define GZ_EOF -1
183417Scsgr
193784Sphk#define GZ_WSIZE 0x8000
203417Scsgr
213417Scsgr/*
223417Scsgr * Global variables used by inflate and friends.
233417Scsgr * This structure is used in order to make inflate() reentrant.
243417Scsgr */
253784Sphkstruct inflate {
263784Sphk	/* Public part */
273784Sphk
283784Sphk	/* This pointer is passed along to the two functions below */
293784Sphk	void           *gz_private;
308876Srgrimes
313784Sphk	/* Fetch next character to be uncompressed */
3292719Salfred	int             (*gz_input)(void *);
333784Sphk
343784Sphk	/* Dispose of uncompressed characters */
3592719Salfred	int             (*gz_output)(void *, u_char *, u_long);
363784Sphk
373784Sphk	/* Private part */
383784Sphk	u_long          gz_bb;	/* bit buffer */
393784Sphk	unsigned        gz_bk;	/* bits in bit buffer */
403784Sphk	unsigned        gz_hufts;	/* track memory usage */
413784Sphk	struct huft    *gz_fixed_tl;	/* must init to NULL !! */
423784Sphk	struct huft    *gz_fixed_td;
433784Sphk	int             gz_fixed_bl;
443784Sphk	int             gz_fixed_bd;
453784Sphk	u_char         *gz_slide;
463784Sphk	unsigned        gz_wp;
473417Scsgr};
483417Scsgr
4992719Salfredint inflate(struct inflate *);
503417Scsgr
5155205Speter#endif	/* _KERNEL || KZIP */
523417Scsgr
533784Sphk#endif	/* ! _SYS_INFLATE_H_ */
54