1 #pragma prototyped
2 
3 /*
4  * zip huffman codeing interface
5  */
6 
7 #ifndef _HUFF_H
8 #define _HUFF_H		1
9 
10 #include "zip.h"
11 
12 #include <vmalloc.h>
13 
14 /* Huffman code lookup table entry--this entry is four bytes for machines
15    that have 16-bit pointers (e.g. PC's in the small or medium model).
16    Valid extra bits are 0..13.	e == 15 is EOB (end of block), e == 16
17    means that v is a literal, 16 < e < 32 means that v is a pointer to
18    the next table, which codes e - 16 bits, and lastly e == 99 indicates
19    an unused code.  If a code with e == 99 is looked up, this implies an
20    error in the data. */
21 
22 struct Huff_s; typedef struct Huff_s Huff_t;
23 
24 struct Huff_s
25 {
26     uch			e;	/* number of extra bits or operation */
27     uch			b;	/* number of bits in this code or subcode */
28     union
29     {
30 	ush		n;	/* literal, length base, or distance base */
31 	Huff_t*		t;	/* pointer to next level of table */
32     } v;
33 };
34 
35 extern int	huff(ulg*, ulg, ulg, ush*, ush*, Huff_t**, int*, Vmalloc_t*);
36 
37 #endif
38