home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource4
/
270_01
/
diff.h
< prev
next >
Wrap
Text File
|
1979-12-31
|
1KB
|
49 lines
/**
DIFF.H
Header file for DIFF.C
**/
/* Constant Values */
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define PAGESIZE 4096 /* default line page size */
#define MASK 0x0FFF /* 12 bit hash value */
#define MAXLINE 256 /* maximum line length */
#define CHANGE 0 /* change a range of lines */
#define DELETE 1 /* delete a range of lines */
#define ADD 2 /* add a range of lines */
/* Data Types */
typedef int BOOL ;
typedef struct
{
long addr ; /* address of string in file */
unsigned int hash ; /* hash value for string */
int linenum ; /* line number in file */
}
LINE ;
/**
Function prototypes
**/
static unsigned int Hash(char *);
static LINE *ReadFile(FILE *, int *);
static BOOL CheckHashes(LINE *, LINE *, int);
static int CheckStrings(FILE *, LINE *, FILE *, LINE *, int);
static void PrintLines(FILE *, LINE *, int , FILE *, LINE *, int);
static void DoDiff(FILE *, LINE *, int, FILE *, LINE *, int, int);
static void banner(void);
void main(int, char **);