xref: /freebsd-src/contrib/diff/lib/exclude.h (revision 18fd37a72c3a7549d2d4f6c6ea00bdcd2bdaca01)
1*18fd37a7SXin LI /* exclude.h -- declarations for excluding file names
2*18fd37a7SXin LI 
3*18fd37a7SXin LI    Copyright (C) 1992, 1993, 1994, 1997, 1999, 2001, 2002, 2003 Free
4*18fd37a7SXin LI    Software Foundation, Inc.
5*18fd37a7SXin LI 
6*18fd37a7SXin LI    This program is free software; you can redistribute it and/or modify
7*18fd37a7SXin LI    it under the terms of the GNU General Public License as published by
8*18fd37a7SXin LI    the Free Software Foundation; either version 2, or (at your option)
9*18fd37a7SXin LI    any later version.
10*18fd37a7SXin LI 
11*18fd37a7SXin LI    This program is distributed in the hope that it will be useful,
12*18fd37a7SXin LI    but WITHOUT ANY WARRANTY; without even the implied warranty of
13*18fd37a7SXin LI    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*18fd37a7SXin LI    GNU General Public License for more details.
15*18fd37a7SXin LI 
16*18fd37a7SXin LI    You should have received a copy of the GNU General Public License
17*18fd37a7SXin LI    along with this program; see the file COPYING.
18*18fd37a7SXin LI    If not, write to the Free Software Foundation,
19*18fd37a7SXin LI    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
20*18fd37a7SXin LI 
21*18fd37a7SXin LI /* Written by Paul Eggert <eggert@twinsun.com>  */
22*18fd37a7SXin LI 
23*18fd37a7SXin LI /* Exclude options, which can be ORed with fnmatch options.  */
24*18fd37a7SXin LI 
25*18fd37a7SXin LI /* Patterns must match the start of file names, instead of matching
26*18fd37a7SXin LI    anywhere after a '/'.  */
27*18fd37a7SXin LI #define EXCLUDE_ANCHORED (1 << 30)
28*18fd37a7SXin LI 
29*18fd37a7SXin LI /* Include instead of exclude.  */
30*18fd37a7SXin LI #define EXCLUDE_INCLUDE (1 << 29)
31*18fd37a7SXin LI 
32*18fd37a7SXin LI /* '?', '*', '[', and '\\' are special in patterns.  Without this
33*18fd37a7SXin LI    option, these characters are ordinary and fnmatch is not used.  */
34*18fd37a7SXin LI #define EXCLUDE_WILDCARDS (1 << 28)
35*18fd37a7SXin LI 
36*18fd37a7SXin LI struct exclude;
37*18fd37a7SXin LI 
38*18fd37a7SXin LI struct exclude *new_exclude (void);
39*18fd37a7SXin LI void free_exclude (struct exclude *);
40*18fd37a7SXin LI void add_exclude (struct exclude *, char const *, int);
41*18fd37a7SXin LI int add_exclude_file (void (*) (struct exclude *, char const *, int),
42*18fd37a7SXin LI 		      struct exclude *, char const *, int, char);
43*18fd37a7SXin LI bool excluded_filename (struct exclude const *, char const *);
44