xref: /openbsd-src/usr.bin/cvs/diff.h (revision a28daedfc357b214be5c701aa8ba8adb29a7f1c2)
1 /*	$OpenBSD: diff.h,v 1.18 2009/04/28 09:05:40 sthen Exp $	*/
2 /*
3  * Copyright (C) Caldera International Inc.  2001-2002.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code and documentation must retain the above
10  *    copyright notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  * 3. All advertising materials mentioning features or use of this software
15  *    must display the following acknowledgement:
16  *	This product includes software developed or owned by Caldera
17  *	International, Inc.
18  * 4. Neither the name of Caldera International, Inc. nor the names of other
19  *    contributors may be used to endorse or promote products derived from
20  *    this software without specific prior written permission.
21  *
22  * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
23  * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
24  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26  * IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE FOR ANY DIRECT,
27  * INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
32  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
35 /*-
36  * Copyright (c) 1991, 1993
37  *	The Regents of the University of California.  All rights reserved.
38  * Copyright (c) 2004 Jean-Francois Brousseau.  All rights reserved.
39  *
40  * Redistribution and use in source and binary forms, with or without
41  * modification, are permitted provided that the following conditions
42  * are met:
43  * 1. Redistributions of source code must retain the above copyright
44  *    notice, this list of conditions and the following disclaimer.
45  * 2. Redistributions in binary form must reproduce the above copyright
46  *    notice, this list of conditions and the following disclaimer in the
47  *    documentation and/or other materials provided with the distribution.
48  * 3. Neither the name of the University nor the names of its contributors
49  *    may be used to endorse or promote products derived from this software
50  *    without specific prior written permission.
51  *
52  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
53  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
54  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
55  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
56  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
57  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
58  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
59  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
60  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
61  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62  * SUCH DAMAGE.
63  *
64  *	@(#)diffreg.c   8.1 (Berkeley) 6/6/93
65  */
66 #ifndef CVS_DIFF_H
67 #define CVS_DIFF_H
68 #define CVS_DIFF_DEFCTX	3	/* default context length */
69 
70 /*
71  * Output format options
72  */
73 #define	D_NORMAL	0	/* Normal output */
74 #define	D_CONTEXT	1	/* Diff with context */
75 #define	D_UNIFIED	2	/* Unified context diff */
76 #define	D_IFDEF		3	/* Diff with merged #ifdef's */
77 #define	D_BRIEF		4	/* Say if the files differ */
78 #define	D_RCSDIFF	5       /* Reverse editor output: RCS format */
79 
80 /*
81  * Status values for cvs_diffreg() return values
82  */
83 #define	D_SAME		0	/* Files are the same */
84 #define	D_DIFFER	1	/* Files are different */
85 #define	D_BINARY	2	/* Binary files are different */
86 #define	D_COMMON	3	/* Subdirectory common to both dirs */
87 #define	D_ONLY		4	/* Only exists in one directory */
88 #define	D_MISMATCH1	5	/* path1 was a dir, path2 a file */
89 #define	D_MISMATCH2	6	/* path1 was a file, path2 a dir */
90 #define	D_ERROR		7	/* An error occurred */
91 #define	D_SKIPPED1	8	/* path1 was a special file */
92 #define	D_SKIPPED2	9	/* path2 was a special file */
93 
94 void		cvs_merge_file(struct cvs_file *, int);
95 void		diff_output(const char *, ...);
96 int		cvs_diffreg(const char *, const char *, int, int, BUF *);
97 int		ed_patch_lines(struct cvs_lines *, struct cvs_lines *);
98 
99 extern int       diff_format;
100 extern int	 diff3_conflicts;
101 extern int	 diff_aflag;
102 extern int	 diff_bflag;
103 extern int	 diff_dflag;
104 extern int	 diff_iflag;
105 extern int	 diff_pflag;
106 extern int	 diff_wflag;
107 extern char	*diff_file;
108 extern char	 diffargs[128];
109 extern BUF	*diffbuf;
110 extern RCSNUM	*diff_rev1;
111 extern RCSNUM	*diff_rev2;
112 extern RCSNUM	*d3rev1;
113 extern RCSNUM	*d3rev2;
114 
115 #endif
116