home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 March
/
VPR9703A.ISO
/
OLS
/
Os2
/
LHA2P205
/
LHA2P205.LZH
/
lha2-2.05pre
/
source.lzh
/
src
/
slidehuf.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-10-15
|
3KB
|
123 lines
/*
* slidehuf.h
* Copyright (C) 1988-1992, Haruyasu YOSHIZAKI
* Copyright (C) 1991-1995, Satoshi HIRAMATSU (OS/2 HPFS version)
*
* $Log$
*/
#ifndef __INCLUDED_SLIDEHUF_H
#define __INCLUDED_SLIDEHUF_H
#ifdef __cplusplus
extern "C" {
#endif
struct encode_option
{
void (*output)();
void (*encode_start)();
void (*encode_end)();
};
struct decode_option
{
ushort (*decode_c)();
ushort (*decode_p)();
void (*decode_start)();
};
/* from slide.c */
#define MAX_DICBIT 13
#define MAX_DICSIZ (1U << MAX_DICBIT)
#define MATCHBIT 8 /* bits for MAXMATCH - THRESHOLD */
#define MAXMATCH 256 /* formerly F (not more than UCHAR_MAX + 1) */
#define THRESHOLD 3 /* choose optimal value */
extern int unpackable;
extern ulong origsize, compsize;
extern ushort dicbit;
extern ushort maxmatch;
extern ulong count;
extern ushort loc;
/* from huf.c */
/* alphabet = {0, 1, 2, ..., NC - 1} */
#define NC (UCHAR_MAX + MAXMATCH + 2 - THRESHOLD)
#define CBIT 9 /* $\lfloor \log_2 NC \rfloor + 1$ */
#define USHRT_BIT 16 /* (CHAR_BIT * sizeof(ushort)) */
extern ushort left[], right[];
extern uchar c_len[], pt_len[];
extern ushort c_freq[], c_table[], c_code[],
p_freq[], pt_table[], pt_code[], t_freq[];
void output_st1(ushort, ushort);
void *alloc_buf(void);
void encode_start_st1(void);
void decode_start_st1(void);
void encode_end_st1(void);
ushort decode_c_st1(void);
ushort decode_p_st1(void);
/* from shuf.c */
void decode_start_st0(void);
void encode_p_st0(unsigned short);
void encode_start_fix(void);
void decode_start_fix(void);
ushort decode_c_st0(void);
ushort decode_p_st0(void);
/* from dhuf.c */
extern uint n_max;
void start_c_dyn(void);
void decode_start_dyn(void);
ushort decode_c_dyn(void);
ushort decode_p_dyn(void);
void output_dyn(int, unsigned int);
void encode_end_dyn(void);
/* from larc.c */
ushort decode_c_lzs(void);
ushort decode_p_lzs(void);
ushort decode_c_lz5(void);
ushort decode_p_lz5(void);
void decode_start_lzs(void);
void decode_start_lz5(void);
/* from maketbl.c */
void make_table(short, uchar *, short, ushort *);
/* from maketree.c */
void make_code(short, uchar *, ushort *);
short make_tree(short, ushort *, uchar *, ushort *);
/* from crcio.c */
extern FILE *infile, *outfile;
extern ushort bitbuf;
extern int dispflg;
void fillbuf(uchar);
ushort getbits(uchar);
void putcode(uchar, ushort);
void putbits(uchar, ushort);
int fread_crc(uchar *, int, FILE *, hword *);
void fwrite_crc(uchar *, int, FILE *, hword *);
void init_getbits(void);
void init_putbits(void);
#ifdef __cplusplus
}
#endif
#endif /* __INCLUDED_SLIDEHUF_H */