1 /* $Id: squish.h,v 2.2 2005/01/22 17:15:57 matthew Exp $*/
8 * machine variants which require cc -Dmachine: pdp11, z8000, pcxt
12 * Set USERMEM to the maximum amount of physical user memory available
13 * in bytes. USERMEM is used to determine the maximum BITS that can be used
16 * SACREDMEM is the amount of physical memory saved for others; compress
24 # define USERMEM 450000 /* default user memory */
27 #ifdef interdata /* (Perkin-Elmer) */
28 #define SIGNED_COMPARE_SLOW /* signed compare is slower than unsigned */
32 # define BITS 12 /* max bits/code for 16-bit machine */
33 # define NO_UCHAR /* also if "unsigned char" functions as signed char */
35 #endif /* pdp11 */ /* don't forget to compile with -i */
39 # undef vax /* weird preprocessor */
49 # if USERMEM >= (433484+SACREDMEM)
52 # if USERMEM >= (229600+SACREDMEM)
55 # if USERMEM >= (127536+SACREDMEM)
58 # if USERMEM >= (73464+SACREDMEM)
69 #ifdef PBITS /* Preferred BITS for this memory size */
76 # define HSIZE 69001 /* 95% occupancy */
79 # define HSIZE 35023 /* 94% occupancy */
82 # define HSIZE 18013 /* 91% occupancy */
85 # define HSIZE 9001 /* 91% occupancy */
88 # define HSIZE 5003 /* 80% occupancy */
91 #ifdef M_XENIX /* Stupid compiler can't handle arrays with */
92 # if BITS == 16 /* more than 65535 bytes - so we fake it */
95 # if BITS > 13 /* Code only handles BITS = 12, 13, or 16 */
102 * a code_int must be able to hold 2**BITS values of type int, and also -1
105 typedef long int code_int;
107 typedef int code_int;
110 #ifdef SIGNED_COMPARE_SLOW
111 typedef unsigned long int count_int;
112 typedef unsigned short int count_short;
114 typedef long int count_int;
118 typedef char char_type;
120 typedef unsigned char char_type;
122 char_type magic_header[] = { "\037\235" }; /* 1F 9D */
124 /* Defines for third byte of header */
125 #define BIT_MASK 0x1f
126 #define BLOCK_MASK 0x80
127 /* Masks 0x40 and 0x20 are free. I think 0x20 should mean that there is
128 a fourth header byte (for expansion).
130 #define INIT_BITS 9 /* initial number of bits/code */
135 void output(code_int code);
136 void decompress(void);
137 code_int getcode(void);
139 int foreground(void);
142 void cl_block (void);
143 void do_clearblock(void);
144 void cl_hash(count_int lhsize);
145 void prratio(FILE *stream,long int num,long int den);
148 #endif /*__SQUISH_H__*/