Annotation of src/usr.bin/rcs/diff.h, Revision 1.9
1.9 ! ray 1: /* $OpenBSD: diff.h,v 1.8 2009/07/14 14:09:46 jsg Exp $ */
1.1 joris 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: */
1.9 ! ray 66: #ifndef DIFF_H
! 67: #define DIFF_H
1.6 xsa 68:
69: #include <sys/queue.h>
70:
71: #include <regex.h>
1.1 joris 72:
73: #include "buf.h"
74: #include "rcs.h"
75:
76: /*
77: * Output format options
78: */
79: #define D_NORMAL 0 /* Normal output */
80: #define D_CONTEXT 1 /* Diff with context */
81: #define D_UNIFIED 2 /* Unified context diff */
82: #define D_IFDEF 3 /* Diff with merged #ifdef's */
83: #define D_BRIEF 4 /* Say if the files differ */
84: #define D_RCSDIFF 5 /* Reverse editor output: RCS format */
85:
86: /*
1.5 millert 87: * Command line flags
88: */
89: #define D_FORCEASCII 0x01 /* Treat file as ascii regardless of content */
90: #define D_FOLDBLANKS 0x02 /* Treat all white space as equal */
91: #define D_MINIMAL 0x04 /* Make diff as small as possible */
92: #define D_IGNORECASE 0x08 /* Case-insensitive matching */
93: #define D_PROTOTYPE 0x10 /* Display C function prototype */
94: #define D_EXPANDTABS 0x20 /* Expand tabs to spaces */
95: #define D_IGNOREBLANKS 0x40 /* Ignore white space changes */
96:
97: /*
1.7 ray 98: * Status values for diffreg() return values
1.1 joris 99: */
100: #define D_SAME 0 /* Files are the same */
101: #define D_DIFFER 1 /* Files are different */
1.2 xsa 102: #define D_ERROR 2 /* An error occurred */
1.3 xsa 103:
104: /*
105: * Status values for rcs_diff3() return values
106: */
107: #define D_OVERLAPS 1 /* Overlaps during merge */
1.1 joris 108:
109: struct rcs_lines;
110:
111: BUF *rcs_diff3(RCSFILE *, char *, RCSNUM *, RCSNUM *, int);
1.4 xsa 112: BUF *merge_diff3(char **, int);
1.1 joris 113: void diff_output(const char *, ...);
1.7 ray 114: int diffreg(const char *, const char *, BUF *, int);
1.1 joris 115: int ed_patch_lines(struct rcs_lines *, struct rcs_lines *);
116:
1.5 millert 117: extern int diff_context;
1.1 joris 118: extern int diff_format;
119: extern int diff3_conflicts;
1.8 jsg 120: extern char *diff_file;
1.5 millert 121: extern char diffargs[512]; /* XXX */
1.1 joris 122: extern BUF *diffbuf;
123: extern RCSNUM *diff_rev1;
124: extern RCSNUM *diff_rev2;
1.5 millert 125: extern regex_t *diff_ignore_re;
1.1 joris 126:
1.9 ! ray 127: #endif /* DIFF_H */