--- diffh.c.orig 1991-11-12 20:31:33 UTC +++ diffh.c @@ -6,6 +6,7 @@ static char sccsid[] = "@(#)diffh.c 4.4 11/27/85"; #include #include #include +#include #define C 3 #define RANGE 30 @@ -20,13 +21,24 @@ int bflag; int debug = 0; FILE *file[2]; +/* declarations */ +void error(char *, char *); +char cmp(char *, char *); +void range(long, int); +void change(long, int, long, int, char *); +int output(int, int); +void progerr(char *); +int hardsynch(); +int easysynch(); +void movstr(char *, char *t); +void clrl(int, long); + /* return pointer to line n of file f*/ char *getl(f,n) long n; { register char *t; - char *malloc(); - register delta, nt; + register int delta, nt; again: delta = n - lineno[f]; nt = ntext[f]; @@ -43,11 +55,12 @@ again: t = text[f][nt]; if(t==0) { t = text[f][nt] = malloc(LEN+1); - if(t==NULL) + if(t==NULL) { if(hardsynch()) goto again; else progerr("5"); + } } t = fgets(t,LEN,file[f]); if(t!=NULL) @@ -56,10 +69,10 @@ again: } /*remove thru line n of file f from storage*/ -clrl(f,n) +void clrl(f,n) long n; { - register i,j; + register int i,j; j = n-lineno[f]+1; for(i=0;i+j