exp2l: Work around a NetBSD 10.0/i386 bug.
[gnulib.git] / lib / exclude.h
blob0783b087326e6b09cc69f45251b70b1a4840c8e4
1 /* exclude.h -- declarations for excluding file names
3 Copyright (C) 1992-1994, 1997, 1999, 2001-2003, 2005-2006, 2009-2024 Free
4 Software Foundation, Inc.
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.
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.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <https://www.gnu.org/licenses/>. */
19 #ifndef _GL_EXCLUDE_H
20 #define _GL_EXCLUDE_H 1
22 /* This file uses _GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_MALLOC,
23 _GL_ATTRIBUTE_NONNULL, _GL_ATTRIBUTE_PURE, _GL_ATTRIBUTE_RETURNS_NONNULL. */
24 #if !_GL_CONFIG_H_INCLUDED
25 #error "Please include config.h first."
26 #endif
28 #include <stdio.h>
30 /* Written by Paul Eggert <eggert@twinsun.com>
31 and Sergey Poznyakoff <gray@gnu.org> */
33 /* Exclude options, which can be ORed with fnmatch options. */
35 /* Patterns must match the start of file names, instead of matching
36 anywhere after a '/'. */
37 #define EXCLUDE_ANCHORED (1 << 30)
39 /* Include instead of exclude. */
40 #define EXCLUDE_INCLUDE (1 << 29)
42 /* '?', '*', '[', and '\\' are special in patterns. Without this
43 option, these characters are ordinary and fnmatch is not used. */
44 #define EXCLUDE_WILDCARDS (1 << 28)
46 /* Patterns are POSIX extended regular expressions */
47 #define EXCLUDE_REGEX (1 << 27)
49 /* Allocate storage for the pattern */
50 #define EXCLUDE_ALLOC (1 << 26)
52 struct exclude;
54 bool fnmatch_pattern_has_wildcards (const char *, int) _GL_ATTRIBUTE_PURE;
56 void free_exclude (struct exclude *)
57 _GL_ATTRIBUTE_NONNULL ((1));
58 struct exclude *new_exclude (void)
59 _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_RETURNS_NONNULL
60 _GL_ATTRIBUTE_DEALLOC (free_exclude, 1);
61 void add_exclude (struct exclude *, char const *, int);
62 int add_exclude_file (void (*) (struct exclude *, char const *, int),
63 struct exclude *, char const *, int, char);
64 int add_exclude_fp (void (*) (struct exclude *, char const *, int, void *),
65 struct exclude *, FILE *, int, char, void *);
66 bool excluded_file_name (struct exclude const *, char const *);
67 void exclude_add_pattern_buffer (struct exclude *ex, char *buf);
68 bool exclude_fnmatch (char const *, char const *, int);
70 #endif /* _GL_EXCLUDE_H */