1*5716a8f5Schristos /* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
2*5716a8f5Schristos 
3*5716a8f5Schristos NOTE: The canonical source of this file is maintained with the GNU C Library.
4*5716a8f5Schristos Bugs can be reported to bug-glibc@prep.ai.mit.edu.
5*5716a8f5Schristos 
6*5716a8f5Schristos This program is free software; you can redistribute it and/or modify it
7*5716a8f5Schristos under the terms of the GNU General Public License as published by the
8*5716a8f5Schristos Free Software Foundation; either version 2, or (at your option) any
9*5716a8f5Schristos later version.
10*5716a8f5Schristos 
11*5716a8f5Schristos This program is distributed in the hope that it will be useful,
12*5716a8f5Schristos but WITHOUT ANY WARRANTY; without even the implied warranty of
13*5716a8f5Schristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*5716a8f5Schristos GNU General Public License for more details.
15*5716a8f5Schristos 
16*5716a8f5Schristos You should have received a copy of the GNU General Public License
17*5716a8f5Schristos along with this program; if not, write to the Free Software Foundation,
18*5716a8f5Schristos Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
19*5716a8f5Schristos 
20*5716a8f5Schristos #ifndef	_FNMATCH_H
21*5716a8f5Schristos 
22*5716a8f5Schristos #define	_FNMATCH_H	1
23*5716a8f5Schristos 
24*5716a8f5Schristos #ifdef	__cplusplus
25*5716a8f5Schristos extern "C" {
26*5716a8f5Schristos #endif
27*5716a8f5Schristos 
28*5716a8f5Schristos #if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
29*5716a8f5Schristos #undef	__P
30*5716a8f5Schristos #define	__P(protos)	protos
31*5716a8f5Schristos #else /* Not C++ or ANSI C.  */
32*5716a8f5Schristos #undef	__P
33*5716a8f5Schristos #define	__P(protos)	()
34*5716a8f5Schristos /* We can get away without defining `const' here only because in this file
35*5716a8f5Schristos    it is used only inside the prototype for `fnmatch', which is elided in
36*5716a8f5Schristos    non-ANSI C where `const' is problematical.  */
37*5716a8f5Schristos #endif /* C++ or ANSI C.  */
38*5716a8f5Schristos 
39*5716a8f5Schristos 
40*5716a8f5Schristos /* We #undef these before defining them because some losing systems
41*5716a8f5Schristos    (HP-UX A.08.07 for example) define these in <unistd.h>.  */
42*5716a8f5Schristos #undef	FNM_PATHNAME
43*5716a8f5Schristos #undef	FNM_NOESCAPE
44*5716a8f5Schristos #undef	FNM_PERIOD
45*5716a8f5Schristos 
46*5716a8f5Schristos /* Bits set in the FLAGS argument to `fnmatch'.  */
47*5716a8f5Schristos #define	FNM_PATHNAME	(1 << 0) /* No wildcard can ever match `/'.  */
48*5716a8f5Schristos #define	FNM_NOESCAPE	(1 << 1) /* Backslashes don't quote special chars.  */
49*5716a8f5Schristos #define	FNM_PERIOD	(1 << 2) /* Leading `.' is matched only explicitly.  */
50*5716a8f5Schristos 
51*5716a8f5Schristos #if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
52*5716a8f5Schristos #define	FNM_FILE_NAME	FNM_PATHNAME /* Preferred GNU name.  */
53*5716a8f5Schristos #define	FNM_LEADING_DIR	(1 << 3) /* Ignore `/...' after a match.  */
54*5716a8f5Schristos #define	FNM_CASEFOLD	(1 << 4) /* Compare without regard to case.  */
55*5716a8f5Schristos #endif
56*5716a8f5Schristos 
57*5716a8f5Schristos /* Value returned by `fnmatch' if STRING does not match PATTERN.  */
58*5716a8f5Schristos #define	FNM_NOMATCH	1
59*5716a8f5Schristos 
60*5716a8f5Schristos /* Match STRING against the filename pattern PATTERN,
61*5716a8f5Schristos    returning zero if it matches, FNM_NOMATCH if not.  */
62*5716a8f5Schristos extern int fnmatch __P ((const char *__pattern, const char *__string,
63*5716a8f5Schristos 			 int __flags));
64*5716a8f5Schristos 
65*5716a8f5Schristos #ifdef	__cplusplus
66*5716a8f5Schristos }
67*5716a8f5Schristos #endif
68*5716a8f5Schristos 
69*5716a8f5Schristos #endif /* fnmatch.h */
70