1: /* diff.h 4.7 85/08/16 */
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: #define D_NREVERSE 4 /* Reverse ed script with numbered
25: lines and no trailing . */
26:
27: int tflag; /* expand tabs on output */
28:
29: /*
30: * Algorithm related options
31: */
32: int hflag; /* -h, use halfhearted DIFFH */
33: int bflag; /* ignore blanks in comparisons */
34: int wflag; /* totally ignore blanks in comparisons */
35: int iflag; /* ignore case in comparisons */
36:
37: /*
38: * Options on hierarchical diffs.
39: */
40: int lflag; /* long output format with header */
41: int rflag; /* recursively trace directories */
42: int sflag; /* announce files which are same */
43: char *start; /* do file only if name >= this */
44:
45: /*
46: * Variables for -I D_IFDEF option.
47: */
48: int wantelses; /* -E */
49: char *ifdef1; /* String for -1 */
50: char *ifdef2; /* String for -2 */
51: char *endifname; /* What we will print on next #endif */
52: int inifdef;
53:
54: /*
55: * Variables for -c context option.
56: */
57: int context; /* lines of context to be printed */
58:
59: /*
60: * State for exit status.
61: */
62: int status;
63: int anychange;
64: char *tempfile; /* used when comparing against std input */
65:
66: /*
67: * Variables for diffdir.
68: */
69: char **diffargv; /* option list to pass to recursive diffs */
70:
71: /*
72: * Input file names.
73: * With diffdir, file1 and file2 are allocated BUFSIZ space,
74: * and padded with a '/', and then efile0 and efile1 point after
75: * the '/'.
76: */
77: char *file1, *file2, *efile1, *efile2;
78: struct stat stb1, stb2;
79:
80: char *malloc(), *talloc(), *ralloc();
81: char *savestr(), *splice(), *splicen();
82: char *mktemp(), *copytemp(), *rindex();
83: int done();
84:
85: extern char diffh[], diff[], pr[];
Defined variables
bflag
defined in line
33; used 4 times
efile1
defined in line
77; used 11 times
efile2
defined in line
77; used 11 times
file1
defined in line
77; used 41 times
- in /usr/src/bin/diff/diff.c line
120,
127-131(3)
- in /usr/src/bin/diff/diffdir.c line
50-54(4),
91-98(4),
131-134(2),
147(2),
160,
233-235(2),
256,
281,
289,
301,
322
- in /usr/src/bin/diff/diffreg.c line
156-163(5),
169-177(4),
188-190(2),
222,
474-475(2),
630,
703-704(2)
file2
defined in line
77; used 42 times
- in /usr/src/bin/diff/diff.c line
121,
134-138(3)
- in /usr/src/bin/diff/diffdir.c line
51-55(4),
92-98(4),
131-134(2),
148(2),
160,
238-240(2),
256,
281,
289,
301,
322
- in /usr/src/bin/diff/diffreg.c line
156,
163-170(5),
180-184(4),
193-195(2),
222,
478-479(2),
631,
706-707(2)
hflag
defined in line
32; used 3 times
iflag
defined in line
35; used 4 times
lflag
defined in line
40; used 10 times
opt
defined in line
17; used 38 times
- in /usr/src/bin/diff/diff.c line
29-37(3),
50-61(4),
76,
122
- in /usr/src/bin/diff/diffdir.c line
33-37(2),
75(2),
85(2),
253,
287(2),
297,
304
- in /usr/src/bin/diff/diffreg.c line
260,
635,
654,
664,
698-702(2),
721,
742,
748,
768-774(6),
806,
815,
838
rflag
defined in line
41; used 2 times
sflag
defined in line
42; used 3 times
start
defined in line
43; used 3 times
stb1
defined in line
78; used 12 times
stb2
defined in line
78; used 12 times
tflag
defined in line
27; used 2 times
wflag
defined in line
34; used 5 times
Defined macros
Usage of this include