]>
Commit | Line | Data |
---|---|---|
b80f6443 | 1 | /* Copyright (C) 1991-2004 Free Software Foundation, Inc. |
3185942a JA |
2 | |
3 | This file is part of GNU Bash, the Bourne-Again SHell. | |
4 | ||
5 | Bash is free software: you can redistribute it and/or modify | |
6 | it under the terms of the GNU General Public License as published by | |
7 | the Free Software Foundation, either version 3 of the License, or | |
8 | (at your option) any later version. | |
9 | ||
10 | Bash is distributed in the hope that it will be useful, | |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | GNU General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU General Public License | |
16 | along with Bash. If not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
726f6388 | 18 | |
f73dda09 JA |
19 | #ifndef _STRMATCH_H |
20 | #define _STRMATCH_H 1 | |
21 | ||
b80f6443 | 22 | #include <config.h> |
726f6388 | 23 | |
b72432fd JA |
24 | #include "stdc.h" |
25 | ||
cce855bc JA |
26 | /* We #undef these before defining them because some losing systems |
27 | (HP-UX A.08.07 for example) define these in <unistd.h>. */ | |
28 | #undef FNM_PATHNAME | |
29 | #undef FNM_NOESCAPE | |
30 | #undef FNM_PERIOD | |
31 | ||
f73dda09 JA |
32 | /* Bits set in the FLAGS argument to `strmatch'. */ |
33 | ||
34 | /* standard flags are like fnmatch(3). */ | |
cce855bc JA |
35 | #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ |
36 | #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ | |
37 | #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ | |
38 | ||
f73dda09 JA |
39 | /* extended flags not available in most libc fnmatch versions, but we undef |
40 | them to avoid any possible warnings. */ | |
41 | #undef FNM_LEADING_DIR | |
42 | #undef FNM_CASEFOLD | |
43 | #undef FNM_EXTMATCH | |
44 | ||
cce855bc JA |
45 | #define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ |
46 | #define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ | |
47 | #define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */ | |
726f6388 | 48 | |
f73dda09 JA |
49 | /* Value returned by `strmatch' if STRING does not match PATTERN. */ |
50 | #undef FNM_NOMATCH | |
51 | ||
726f6388 JA |
52 | #define FNM_NOMATCH 1 |
53 | ||
54 | /* Match STRING against the filename pattern PATTERN, | |
55 | returning zero if it matches, FNM_NOMATCH if not. */ | |
f73dda09 JA |
56 | extern int strmatch __P((char *, char *, int)); |
57 | ||
b80f6443 JA |
58 | #if HANDLE_MULTIBYTE |
59 | extern int wcsmatch __P((wchar_t *, wchar_t *, int)); | |
60 | #endif | |
726f6388 | 61 | |
f73dda09 | 62 | #endif /* _STRMATCH_H */ |