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