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