blob: 5c99e0cae9938ab410fc68fd8e9a2a34105fc128 [file] [log] [blame]
Jari Aaltob80f6442004-07-27 13:29:18 +00001/* Copyright (C) 1991-2004 Free Software Foundation, Inc.
Jari Aalto726f6381996-08-26 18:22:31 +00002
Jari Aalto31859422009-01-12 13:36:28 +00003 This file is part of GNU Bash, the Bourne-Again SHell.
Jari Aalto726f6381996-08-26 18:22:31 +00004
Jari Aalto31859422009-01-12 13:36:28 +00005 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 Aalto726f6381996-08-26 18:22:31 +00009
Jari Aalto31859422009-01-12 13:36:28 +000010 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 Aalto726f6381996-08-26 18:22:31 +000018
Jari Aaltof73dda02001-11-13 17:56:06 +000019#ifndef _STRMATCH_H
20#define _STRMATCH_H 1
21
Jari Aaltob80f6442004-07-27 13:29:18 +000022#include <config.h>
Jari Aalto726f6381996-08-26 18:22:31 +000023
Jari Aaltob72432f1999-02-19 17:11:39 +000024#include "stdc.h"
25
Jari Aaltocce855b1998-04-17 19:52:44 +000026/* 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 Aaltof73dda02001-11-13 17:56:06 +000032/* Bits set in the FLAGS argument to `strmatch'. */
33
34/* standard flags are like fnmatch(3). */
Jari Aaltocce855b1998-04-17 19:52:44 +000035#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 Aaltof73dda02001-11-13 17:56:06 +000039/* 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 Aaltocce855b1998-04-17 19:52:44 +000045#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 Aalto726f6381996-08-26 18:22:31 +000048
Jari Aaltof73dda02001-11-13 17:56:06 +000049/* Value returned by `strmatch' if STRING does not match PATTERN. */
50#undef FNM_NOMATCH
51
Jari Aalto726f6381996-08-26 18:22:31 +000052#define FNM_NOMATCH 1
53
54/* Match STRING against the filename pattern PATTERN,
55 returning zero if it matches, FNM_NOMATCH if not. */
Jari Aaltof73dda02001-11-13 17:56:06 +000056extern int strmatch __P((char *, char *, int));
Jari Aalto726f6381996-08-26 18:22:31 +000057
Jari Aaltob80f6442004-07-27 13:29:18 +000058#if HANDLE_MULTIBYTE
59extern int wcsmatch __P((wchar_t *, wchar_t *, int));
60#endif
Jari Aaltof73dda02001-11-13 17:56:06 +000061
62#endif /* _STRMATCH_H */