178828Sobrien/* Copyright 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
233965Sjdp
333965SjdpNOTE: The canonical source of this file is maintained with the GNU C Library.
433965SjdpBugs can be reported to bug-glibc@prep.ai.mit.edu.
533965Sjdp
633965SjdpThis program is free software; you can redistribute it and/or modify it
733965Sjdpunder the terms of the GNU General Public License as published by the
833965SjdpFree Software Foundation; either version 2, or (at your option) any
933965Sjdplater version.
1033965Sjdp
1133965SjdpThis program is distributed in the hope that it will be useful,
1233965Sjdpbut WITHOUT ANY WARRANTY; without even the implied warranty of
1333965SjdpMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1433965SjdpGNU General Public License for more details.
1533965Sjdp
1633965SjdpYou should have received a copy of the GNU General Public License
1733965Sjdpalong with this program; if not, write to the Free Software
18218822SdimFoundation, 51 Franklin Street - Fifth Floor,
19218822SdimBoston, MA 02110-1301, USA.  */
2033965Sjdp
2133965Sjdp#ifndef	_FNMATCH_H
2233965Sjdp
2333965Sjdp#define	_FNMATCH_H	1
2433965Sjdp
2533965Sjdp#ifdef	__cplusplus
2633965Sjdpextern "C" {
2733965Sjdp#endif
2833965Sjdp
2933965Sjdp#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
3033965Sjdp#undef	__P
3133965Sjdp#define	__P(args)	args
3233965Sjdp#else /* Not C++ or ANSI C.  */
3333965Sjdp#undef	__P
3433965Sjdp#define	__P(args)	()
3533965Sjdp/* We can get away without defining `const' here only because in this file
3633965Sjdp   it is used only inside the prototype for `fnmatch', which is elided in
3733965Sjdp   non-ANSI C where `const' is problematical.  */
3833965Sjdp#endif /* C++ or ANSI C.  */
3933965Sjdp
4033965Sjdp
4133965Sjdp/* We #undef these before defining them because some losing systems
4233965Sjdp   (HP-UX A.08.07 for example) define these in <unistd.h>.  */
4333965Sjdp#undef	FNM_PATHNAME
4433965Sjdp#undef	FNM_NOESCAPE
4533965Sjdp#undef	FNM_PERIOD
4633965Sjdp
4733965Sjdp/* Bits set in the FLAGS argument to `fnmatch'.  */
4833965Sjdp#define	FNM_PATHNAME	(1 << 0) /* No wildcard can ever match `/'.  */
4933965Sjdp#define	FNM_NOESCAPE	(1 << 1) /* Backslashes don't quote special chars.  */
5033965Sjdp#define	FNM_PERIOD	(1 << 2) /* Leading `.' is matched only explicitly.  */
5133965Sjdp
5233965Sjdp#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
5333965Sjdp#define	FNM_FILE_NAME	FNM_PATHNAME /* Preferred GNU name.  */
5433965Sjdp#define	FNM_LEADING_DIR	(1 << 3) /* Ignore `/...' after a match.  */
5533965Sjdp#define	FNM_CASEFOLD	(1 << 4) /* Compare without regard to case.  */
5633965Sjdp#endif
5733965Sjdp
5833965Sjdp/* Value returned by `fnmatch' if STRING does not match PATTERN.  */
5933965Sjdp#define	FNM_NOMATCH	1
6033965Sjdp
6133965Sjdp/* Match STRING against the filename pattern PATTERN,
6233965Sjdp   returning zero if it matches, FNM_NOMATCH if not.  */
6333965Sjdpextern int fnmatch __P ((const char *__pattern, const char *__string,
6433965Sjdp			 int __flags));
6533965Sjdp
6633965Sjdp#ifdef	__cplusplus
6733965Sjdp}
6833965Sjdp#endif
6933965Sjdp
7033965Sjdp#endif /* fnmatch.h */
71