1 /***********************************************************
3 ***********************************************************/
8 typedef unsigned char uchar; /* 8 bits or more */
9 typedef unsigned int uint; /* 16 bits or more */
10 typedef unsigned short ushort; /* 16 bits or more */
11 typedef unsigned long ulong; /* 32 bits or more */
40 /* compress parameter */
41 struct lha_method *method;
45 extern struct lha_opts opts;
46 extern int unpackable;
47 extern ulong origsize, compsize;
51 #define INIT_CRC 0 /* CCITT: 0xFFFF */
52 #define UPDATE_CRC(c) \
53 crc = crctable[(crc ^ (c)) & 0xFF] ^ (crc >> CHAR_BIT)
55 extern FILE *arcfile, *infile, *outfile;
58 #define BITBUFSIZ (CHAR_BIT * sizeof bitbuf)
60 /* encode.c and decode.c */
62 #define MAXDICBIT 16 /* 12(-lh4-) or 13(-lh5-) */
63 #define MAXDICSIZ (1U << MAXDICBIT)
64 #define MATCHBIT 8 /* bits for MAXMATCH - THRESHOLD */
65 #define MAXMATCH 256 /* formerly F (not more than UCHAR_MAX + 1) */
66 #define THRESHOLD 3 /* choose optimal value */
70 #define NC (UCHAR_MAX + MAXMATCH + 2 - THRESHOLD)
71 /* alphabet = {0, 1, 2, ..., NC - 1} */
72 #define CBIT 9 /* $\lfloor \log_2 NC \rfloor + 1$ */
73 #define CODE_BIT 16 /* codeword length */
75 extern ushort left[], right[];
77 #include "prototypes.h"