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