fnmatch.h revision 1.5
112651Skvn/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
212651Skvn
312651SkvnNOTE: The canonical source of this file is maintained with the GNU C Library.
412651SkvnBugs can be reported to bug-glibc@prep.ai.mit.edu.
512651Skvn
612651SkvnThis program is free software; you can redistribute it and/or modify it
712651Skvnunder the terms of the GNU General Public License as published by the
812651SkvnFree Software Foundation; either version 2, or (at your option) any
912651Skvnlater version.
1012651Skvn
1112651SkvnThis program is distributed in the hope that it will be useful,
1212651Skvnbut WITHOUT ANY WARRANTY; without even the implied warranty of
1312651SkvnMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1412651SkvnGNU General Public License for more details.
1512651Skvn
1612651SkvnYou should have received a copy of the GNU General Public License
1712651Skvnalong with this program; if not, write to the Free Software
1812651SkvnFoundation, 51 Franklin Street - Fifth Floor,
1912651SkvnBoston, MA 02110-1301, USA.  */
2012651Skvn
2112651Skvn#ifndef	_FNMATCH_H
2212651Skvn
2312651Skvn#define	_FNMATCH_H	1
2412651Skvn
2512651Skvn#ifdef	__cplusplus
2612651Skvnextern "C" {
2712651Skvn#endif
2812651Skvn
2912651Skvn#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
3012651Skvn#undef	__P
3112651Skvn#define	__P(args)	args
3212651Skvn#else /* Not C++ or ANSI C.  */
3312651Skvn#undef	__P
3412651Skvn#define	__P(args)	()
3512651Skvn/* We can get away without defining `const' here only because in this file
3612651Skvn   it is used only inside the prototype for `fnmatch', which is elided in
3712651Skvn   non-ANSI C where `const' is problematical.  */
3812651Skvn#endif /* C++ or ANSI C.  */
3912651Skvn
4012651Skvn
4112651Skvn/* We #undef these before defining them because some losing systems
4212651Skvn   (HP-UX A.08.07 for example) define these in <unistd.h>.  */
4312651Skvn#undef	FNM_PATHNAME
4412651Skvn#undef	FNM_NOESCAPE
4512651Skvn#undef	FNM_PERIOD
4612651Skvn
4712651Skvn/* Bits set in the FLAGS argument to `fnmatch'.  */
4812651Skvn#define	FNM_PATHNAME	(1 << 0) /* No wildcard can ever match `/'.  */
4912651Skvn#define	FNM_NOESCAPE	(1 << 1) /* Backslashes don't quote special chars.  */
5012651Skvn#define	FNM_PERIOD	(1 << 2) /* Leading `.' is matched only explicitly.  */
5112651Skvn
5212651Skvn#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
5312651Skvn#define	FNM_FILE_NAME	FNM_PATHNAME /* Preferred GNU name.  */
5412651Skvn#define	FNM_LEADING_DIR	(1 << 3) /* Ignore `/...' after a match.  */
5512651Skvn#define	FNM_CASEFOLD	(1 << 4) /* Compare without regard to case.  */
5612651Skvn#endif
5712651Skvn
5812651Skvn/* Value returned by `fnmatch' if STRING does not match PATTERN.  */
5912651Skvn#define	FNM_NOMATCH	1
6012651Skvn
6112651Skvn/* Match STRING against the filename pattern PATTERN,
6212651Skvn   returning zero if it matches, FNM_NOMATCH if not.  */
6312651Skvnextern int fnmatch __P ((const char *__pattern, const char *__string,
6412651Skvn			 int __flags));
6512651Skvn
6612651Skvn#ifdef	__cplusplus
6712651Skvn}
6812651Skvn#endif
6912651Skvn
7012651Skvn#endif /* fnmatch.h */
7112651Skvn