home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
misc
/
volume17
/
freeze
/
part02
/
freeze.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-03-25
|
2KB
|
122 lines
#include <stdio.h>
/* for GCC */
#ifdef SUN4
#include <sys/stdtypes.h>
#else
typedef int mode_t; /* for GCC */
# ifndef getc
# define getc(p) (--(p)->_cnt < 0 ? _filbuf(p) : (int) *(p)->_ptr++)
# endif
# ifndef putc
# define putc(x, p) (--(p)->_cnt < 0 ? _flsbuf((unsigned char) (x), (p)) : (int) (*(p)->_ptr++ = (unsigned char) (x)))
# endif
typedef unsigned short u_short;
#endif
/* end (for GCC) */
#include <ctype.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef DEBUG
#include <assert.h>
#endif
#ifdef __TURBOC__
#define MSDOS
#include <io.h>
#endif
#ifdef MSDOS
#include <stdlib.h>
#endif
typedef unsigned char uchar;
#if defined(BITS) && BITS > 14
typedef unsigned long hash_t;
#else
typedef u_short hash_t;
#endif
#ifdef lint
#define N 256
#else
#define N 8192 /* buffer size */
#endif
#define F 256 /* pre-sence buffer size */
#define THRESHOLD 2
#define _NCHAR (256 - THRESHOLD + _F + 1) /* {code : 0 .. N_CHAR-1} */
#define _T (_NCHAR * 2 - 1) /* size of table */
#define _R (_T - 1) /* root position */
#define _NN 8092
#define _F 256
#ifndef COMPAT
#define N_CHAR _NCHAR
#define T _T
#define R _R
#else
#define _FO 60
#define _NO 4096
#define _NCHARO (256 - THRESHOLD + _FO + 1)
#define _TO (_NCHARO * 2 - 1)
#define _RO (_TO - 1)
#define N_CHAR (new_flg ? _NCHAR : _NCHARO)
#define T (new_flg ? _T : _TO)
#define R (new_flg ? _R : _RO)
#endif
#define ENDOF 256
extern uchar Table[];
extern long in_count, bytes_out;
extern uchar text_buf[];
extern u_short match_position, match_length;
extern short quiet;
/* Note indicator_threshold is triangle number of Kbytes */
extern unsigned long indicator_threshold, indicator_count;
extern short do_melt, topipe;
extern uchar magic_header[];
extern int exit_stat;
extern short new_flg;
#ifdef DEBUG
extern short debug;
extern short verbose;
extern char * pr_char();
extern long symbols_out, refers_out;
#endif /* DEBUG */
#ifdef GATHER_STAT
extern long node_steps, node_matches;
#endif
extern short DecodeChar(), DecodePosition(),
GetByte(), GetNBits();
#ifdef COMPAT
extern short DecodeCOld(), DecodePOld();
#endif
#if defined(BSD42) && !defined(BSD4_2)
#define BSD4_2
#endif