1130803Smarcel/* Copyright 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
2130803Smarcel
3130803SmarcelNOTE: The canonical source of this file is maintained with the GNU C Library.
4130803SmarcelBugs can be reported to bug-glibc@prep.ai.mit.edu.
5130803Smarcel
6130803SmarcelThis program is free software; you can redistribute it and/or modify it
7130803Smarcelunder the terms of the GNU General Public License as published by the
8130803SmarcelFree Software Foundation; either version 2, or (at your option) any
9130803Smarcellater version.
10130803Smarcel
11130803SmarcelThis program is distributed in the hope that it will be useful,
12130803Smarcelbut WITHOUT ANY WARRANTY; without even the implied warranty of
13130803SmarcelMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14130803SmarcelGNU General Public License for more details.
15130803Smarcel
16130803SmarcelYou should have received a copy of the GNU General Public License
17130803Smarcelalong with this program; if not, write to the Free Software
18130803SmarcelFoundation, 59 Temple Place - Suite 330,
19130803SmarcelBoston, MA 02111-1307, USA.  */
20130803Smarcel
21130803Smarcel#ifndef	_FNMATCH_H
22130803Smarcel
23130803Smarcel#define	_FNMATCH_H	1
24130803Smarcel
25130803Smarcel#ifdef	__cplusplus
26130803Smarcelextern "C" {
27130803Smarcel#endif
28130803Smarcel
29130803Smarcel#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
30130803Smarcel#undef	__P
31130803Smarcel#define	__P(args)	args
32130803Smarcel#else /* Not C++ or ANSI C.  */
33130803Smarcel#undef	__P
34130803Smarcel#define	__P(args)	()
35130803Smarcel/* We can get away without defining `const' here only because in this file
36130803Smarcel   it is used only inside the prototype for `fnmatch', which is elided in
37130803Smarcel   non-ANSI C where `const' is problematical.  */
38130803Smarcel#endif /* C++ or ANSI C.  */
39130803Smarcel
40130803Smarcel
41130803Smarcel/* We #undef these before defining them because some losing systems
42130803Smarcel   (HP-UX A.08.07 for example) define these in <unistd.h>.  */
43130803Smarcel#undef	FNM_PATHNAME
44130803Smarcel#undef	FNM_NOESCAPE
45130803Smarcel#undef	FNM_PERIOD
46130803Smarcel
47130803Smarcel/* Bits set in the FLAGS argument to `fnmatch'.  */
48130803Smarcel#define	FNM_PATHNAME	(1 << 0) /* No wildcard can ever match `/'.  */
49130803Smarcel#define	FNM_NOESCAPE	(1 << 1) /* Backslashes don't quote special chars.  */
50130803Smarcel#define	FNM_PERIOD	(1 << 2) /* Leading `.' is matched only explicitly.  */
51130803Smarcel
52130803Smarcel#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
53130803Smarcel#define	FNM_FILE_NAME	FNM_PATHNAME /* Preferred GNU name.  */
54130803Smarcel#define	FNM_LEADING_DIR	(1 << 3) /* Ignore `/...' after a match.  */
55130803Smarcel#define	FNM_CASEFOLD	(1 << 4) /* Compare without regard to case.  */
56130803Smarcel#endif
57130803Smarcel
58130803Smarcel/* Value returned by `fnmatch' if STRING does not match PATTERN.  */
59130803Smarcel#define	FNM_NOMATCH	1
60130803Smarcel
61130803Smarcel/* Match STRING against the filename pattern PATTERN,
62130803Smarcel   returning zero if it matches, FNM_NOMATCH if not.  */
63130803Smarcelextern int fnmatch __P ((const char *__pattern, const char *__string,
64130803Smarcel			 int __flags));
65130803Smarcel
66130803Smarcel#ifdef	__cplusplus
67130803Smarcel}
68130803Smarcel#endif
69130803Smarcel
70130803Smarcel#endif /* fnmatch.h */
71