Line 0
Link Here
|
|
|
1 |
--- diffextern.h |
2 |
+++ diffextern.h |
3 |
@@ -0,0 +1,102 @@ |
4 |
+/* diffextern.h 2.11.1 20/08/26 */ |
5 |
+ |
6 |
+/* |
7 |
+ * diff external - common declarations |
8 |
+ */ |
9 |
+ |
10 |
+#include <stdio.h> |
11 |
+#include <stdlib.h> |
12 |
+#include <ctype.h> |
13 |
+#include <sys/param.h> |
14 |
+#include <sys/stat.h> |
15 |
+#include <dirent.h> |
16 |
+#include <signal.h> |
17 |
+#include <string.h> |
18 |
+#include <unistd.h> |
19 |
+#include <fcntl.h> |
20 |
+#include <sys/wait.h> |
21 |
+#include <arpa/inet.h> |
22 |
+ |
23 |
+/* |
24 |
+ * Output format options |
25 |
+ */ |
26 |
+extern int opt; |
27 |
+ |
28 |
+#define D_NORMAL 0 /* Normal output */ |
29 |
+#define D_EDIT -1 /* Editor script out */ |
30 |
+#define D_REVERSE 1 /* Reverse editor script */ |
31 |
+#define D_CONTEXT 2 /* Diff with context */ |
32 |
+#define D_IFDEF 3 /* Diff with merged #ifdef's */ |
33 |
+#define D_NREVERSE 4 /* Reverse ed script with numbered |
34 |
+ lines and no trailing . */ |
35 |
+ |
36 |
+extern int tflag; /* expand tabs on output */ |
37 |
+ |
38 |
+/* |
39 |
+ * Algorithm related options |
40 |
+ */ |
41 |
+extern int hflag; /* -h, use halfhearted DIFFH */ |
42 |
+extern int bflag; /* ignore blanks in comparisons */ |
43 |
+extern int wflag; /* totally ignore blanks in comparisons */ |
44 |
+extern int iflag; /* ignore case in comparisons */ |
45 |
+ |
46 |
+/* |
47 |
+ * Options on hierarchical diffs. |
48 |
+ */ |
49 |
+extern int lflag; /* long output format with header */ |
50 |
+extern int rflag; /* recursively trace directories */ |
51 |
+extern int sflag; /* announce files which are same */ |
52 |
+extern char *start; /* do file only if name >= this */ |
53 |
+ |
54 |
+/* |
55 |
+ * Variables for -I D_IFDEF option. |
56 |
+ */ |
57 |
+extern int wantelses; /* -E */ |
58 |
+extern char *ifdef1; /* String for -1 */ |
59 |
+extern char *ifdef2; /* String for -2 */ |
60 |
+extern char *endifname; /* What we will print on next #endif */ |
61 |
+extern int inifdef; |
62 |
+ |
63 |
+/* |
64 |
+ * Variables for -c context option. |
65 |
+ */ |
66 |
+extern int context; /* lines of context to be printed */ |
67 |
+ |
68 |
+/* |
69 |
+ * State for exit status. |
70 |
+ */ |
71 |
+extern int status; |
72 |
+extern int anychange; |
73 |
+extern char tempfile[MAXPATHLEN];/* used when comparing against std input */ |
74 |
+ |
75 |
+/* |
76 |
+ * Variables for diffdir. |
77 |
+ */ |
78 |
+extern char **diffargv; /* option list to pass to recursive diffs */ |
79 |
+ |
80 |
+/* |
81 |
+ * Input file names. |
82 |
+ * With diffdir, file1 and file2 are allocated BUFSIZ space, |
83 |
+ * and padded with a '/', and then efile0 and efile1 point after |
84 |
+ * the '/'. |
85 |
+ */ |
86 |
+extern char *file1, *file2, *efile1, *efile2; |
87 |
+extern struct stat stb1, stb2; |
88 |
+ |
89 |
+char *talloc(), *ralloc(); |
90 |
+char *savestr(), *splice(), *splicen(); |
91 |
+char *copytemp(); |
92 |
+sig_t done(); |
93 |
+ |
94 |
+extern char diffh[], diff[], pr[]; |
95 |
+ |
96 |
+/* declarations */ |
97 |
+void diffdir(char **argv); |
98 |
+void diffreg(); |
99 |
+void noroom(); |
100 |
+void setfile(char **fpp, char **epp, char *file); |
101 |
+int useless(register char *cp); |
102 |
+int min(int, int); |
103 |
+int max(int, int); |
104 |
+void prune(); |
105 |
+int skipline(int); |