Jari Aalto | b80f644 | 2004-07-27 13:29:18 +0000 | [diff] [blame] | 1 | /* Copyright (C) 1991-2004 Free Software Foundation, Inc. |
Jari Aalto | 726f638 | 1996-08-26 18:22:31 +0000 | [diff] [blame] | 2 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 3 | This file is part of GNU Bash, the Bourne-Again SHell. |
Jari Aalto | 726f638 | 1996-08-26 18:22:31 +0000 | [diff] [blame] | 4 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 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. |
Jari Aalto | 726f638 | 1996-08-26 18:22:31 +0000 | [diff] [blame] | 9 | |
Jari Aalto | 3185942 | 2009-01-12 13:36:28 +0000 | [diff] [blame] | 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 | */ |
Jari Aalto | 726f638 | 1996-08-26 18:22:31 +0000 | [diff] [blame] | 18 | |
Jari Aalto | f73dda0 | 2001-11-13 17:56:06 +0000 | [diff] [blame] | 19 | #ifndef _STRMATCH_H |
| 20 | #define _STRMATCH_H 1 |
| 21 | |
Jari Aalto | b80f644 | 2004-07-27 13:29:18 +0000 | [diff] [blame] | 22 | #include <config.h> |
Jari Aalto | 726f638 | 1996-08-26 18:22:31 +0000 | [diff] [blame] | 23 | |
Jari Aalto | b72432f | 1999-02-19 17:11:39 +0000 | [diff] [blame] | 24 | #include "stdc.h" |
| 25 | |
Jari Aalto | cce855b | 1998-04-17 19:52:44 +0000 | [diff] [blame] | 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 | |
Jari Aalto | f73dda0 | 2001-11-13 17:56:06 +0000 | [diff] [blame] | 32 | /* Bits set in the FLAGS argument to `strmatch'. */ |
| 33 | |
| 34 | /* standard flags are like fnmatch(3). */ |
Jari Aalto | cce855b | 1998-04-17 19:52:44 +0000 | [diff] [blame] | 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 | |
Jari Aalto | f73dda0 | 2001-11-13 17:56:06 +0000 | [diff] [blame] | 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 | |
Jari Aalto | cce855b | 1998-04-17 19:52:44 +0000 | [diff] [blame] | 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. */ |
Jari Aalto | 726f638 | 1996-08-26 18:22:31 +0000 | [diff] [blame] | 48 | |
Jari Aalto | f73dda0 | 2001-11-13 17:56:06 +0000 | [diff] [blame] | 49 | /* Value returned by `strmatch' if STRING does not match PATTERN. */ |
| 50 | #undef FNM_NOMATCH |
| 51 | |
Jari Aalto | 726f638 | 1996-08-26 18:22:31 +0000 | [diff] [blame] | 52 | #define FNM_NOMATCH 1 |
| 53 | |
| 54 | /* Match STRING against the filename pattern PATTERN, |
| 55 | returning zero if it matches, FNM_NOMATCH if not. */ |
Jari Aalto | f73dda0 | 2001-11-13 17:56:06 +0000 | [diff] [blame] | 56 | extern int strmatch __P((char *, char *, int)); |
Jari Aalto | 726f638 | 1996-08-26 18:22:31 +0000 | [diff] [blame] | 57 | |
Jari Aalto | b80f644 | 2004-07-27 13:29:18 +0000 | [diff] [blame] | 58 | #if HANDLE_MULTIBYTE |
| 59 | extern int wcsmatch __P((wchar_t *, wchar_t *, int)); |
| 60 | #endif |
Jari Aalto | f73dda0 | 2001-11-13 17:56:06 +0000 | [diff] [blame] | 61 | |
| 62 | #endif /* _STRMATCH_H */ |