xref: /original-bsd/usr.bin/diff/diff/diff.h (revision 9087ff44)
1 /*	diff.h	4.6	85/06/07	*/
2 
3 /*
4  * diff - common declarations
5  */
6 
7 #include <stdio.h>
8 #include <ctype.h>
9 #include <sys/param.h>
10 #include <sys/stat.h>
11 #include <sys/dir.h>
12 #include <signal.h>
13 
14 /*
15  * Output format options
16  */
17 int	opt;
18 
19 #define	D_NORMAL	0	/* Normal output */
20 #define	D_EDIT		-1	/* Editor script out */
21 #define	D_REVERSE	1	/* Reverse editor script */
22 #define	D_CONTEXT	2	/* Diff with context */
23 #define	D_IFDEF		3	/* Diff with merged #ifdef's */
24 
25 int	tflag;			/* expand tabs on output */
26 
27 /*
28  * Algorithm related options
29  */
30 int	hflag;			/* -h, use halfhearted DIFFH */
31 int	bflag;			/* ignore blanks in comparisons */
32 int	wflag;			/* totally ignore blanks in comparisons */
33 int	iflag;			/* ignore case in comparisons */
34 
35 /*
36  * Options on hierarchical diffs.
37  */
38 int	lflag;			/* long output format with header */
39 int	rflag;			/* recursively trace directories */
40 int	sflag;			/* announce files which are same */
41 char	*start;			/* do file only if name >= this */
42 
43 /*
44  * Variables for -I D_IFDEF option.
45  */
46 int	wantelses;		/* -E */
47 char	*ifdef1;		/* String for -1 */
48 char	*ifdef2;		/* String for -2 */
49 char	*endifname;		/* What we will print on next #endif */
50 int	inifdef;
51 
52 /*
53  * Variables for -c context option.
54  */
55 int	context;		/* lines of context to be printed */
56 
57 /*
58  * State for exit status.
59  */
60 int	status;
61 int	anychange;
62 char	*tempfile;		/* used when comparing against std input */
63 
64 /*
65  * Variables for diffdir.
66  */
67 char	**diffargv;		/* option list to pass to recursive diffs */
68 
69 /*
70  * Input file names.
71  * With diffdir, file1 and file2 are allocated BUFSIZ space,
72  * and padded with a '/', and then efile0 and efile1 point after
73  * the '/'.
74  */
75 char	*file1, *file2, *efile1, *efile2;
76 struct	stat stb1, stb2;
77 struct	stat stb1, stb2;
78 
79 char	*malloc(), *talloc(), *ralloc();
80 char	*savestr(), *splice(), *splicen();
81 char	*mktemp(), *copytemp(), *rindex();
82 int	done();
83 
84 extern	char diffh[], diff[], pr[];
85