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