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