BSD 4 release
[unix-history] / usr / src / cmd / diff / diff.h
CommitLineData
31cef89c 1/* @(#)diff.h 4.1 10/9/80" */
d519abda
BJ
2
3/*
4 * diff - common declarations
5 */
6
7#include <stdio.h>
8#include <ctype.h>
9#include <sys/types.h>
10#include <sys/stat.h>
11#include <signal.h>
12#include <sys/dir.h>
13
14/*
15 * Output format options
16 */
17int 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/*
26 * Algorithm related options
27 */
28int hflag; /* -h, use halfhearted DIFFH */
29int bflag; /* ignore blanks in comparisions */
30
31/*
32 * Options on hierarchical diffs.
33 */
34int lflag; /* long output format with header */
35int rflag; /* recursively trace directories */
36int sflag; /* announce files which are same */
37char *start; /* do file only if name >= this */
38
39/*
40 * Variables for -I D_IFDEF option.
41 */
42int wantelses; /* -E */
43char *ifdef1; /* String for -1 */
44char *ifdef2; /* String for -2 */
45char *endifname; /* What we will print on next #endif */
46int inifdef;
47
48/*
49 * Variables for -c context option.
50 */
51int context; /* lines of context to be printed */
52
53/*
54 * State for exit status.
55 */
56int status;
57int anychange;
58char *tempfile; /* used when comparing against std input */
59
60/*
61 * Variables for diffdir.
62 */
63char **diffargv; /* option list to pass to recursive diffs */
64
65/*
66 * Input file names.
67 * With diffdir, file1 and file2 are allocated BUFSIZ space,
68 * and padded with a '/', and then efile0 and efile1 point after
69 * the '/'.
70 */
71char *file1, *file2, *efile1, *efile2;
72struct stat stb1, stb2;
73struct stat stb1, stb2;
74
75/*
76 * This is allocated early, and used
77 * to reset the free storage pointer to effect space compaction.
78 */
79char *dummy;
80
81char *malloc(), *talloc(), *ralloc();
82char *savestr(), *splice(), *splicen();
83char *mktemp(), *copytemp(), *rindex();
84int done();
85
86extern char diffh[], diff[], pr[];