fnmatch.h revision 169696
1139804Simp/* Copyright 1991, 1992, 1993, 1996 Free Software Foundation, Inc. 22729Sdfr 32729SdfrNOTE: The canonical source of this file is maintained with the GNU C Library. 42729SdfrBugs can be reported to bug-glibc@prep.ai.mit.edu. 52729Sdfr 62729SdfrThis program is free software; you can redistribute it and/or modify it 72729Sdfrunder the terms of the GNU General Public License as published by the 82729SdfrFree Software Foundation; either version 2, or (at your option) any 92729Sdfrlater version. 102729Sdfr 112729SdfrThis program is distributed in the hope that it will be useful, 122729Sdfrbut WITHOUT ANY WARRANTY; without even the implied warranty of 132729SdfrMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 142729SdfrGNU General Public License for more details. 152729Sdfr 162729SdfrYou should have received a copy of the GNU General Public License 172729Sdfralong with this program; if not, write to the Free Software 182729SdfrFoundation, 51 Franklin Street - Fifth Floor, 19140614SrwatsonBoston, MA 02110-1301, USA. */ 20140614Srwatson 21140614Srwatson#ifndef _FNMATCH_H 22140614Srwatson 23140614Srwatson#define _FNMATCH_H 1 24140614Srwatson 25140614Srwatson#ifdef __cplusplus 26140614Srwatsonextern "C" { 27140614Srwatson#endif 28140614Srwatson 29140614Srwatson#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) 30140614Srwatson#undef __P 31140614Srwatson#define __P(args) args 32140614Srwatson#else /* Not C++ or ANSI C. */ 33140614Srwatson#undef __P 34140614Srwatson#define __P(args) () 35140614Srwatson/* We can get away without defining `const' here only because in this file 36140614Srwatson it is used only inside the prototype for `fnmatch', which is elided in 37140614Srwatson non-ANSI C where `const' is problematical. */ 38140614Srwatson#endif /* C++ or ANSI C. */ 39140614Srwatson 40140614Srwatson 41140614Srwatson/* We #undef these before defining them because some losing systems 42140614Srwatson (HP-UX A.08.07 for example) define these in <unistd.h>. */ 43140614Srwatson#undef FNM_PATHNAME 44140614Srwatson#undef FNM_NOESCAPE 45140614Srwatson#undef FNM_PERIOD 46140614Srwatson 47140614Srwatson/* Bits set in the FLAGS argument to `fnmatch'. */ 48140614Srwatson#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ 492729Sdfr#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ 50116182Sobrien#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ 51116182Sobrien 52116182Sobrien#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) 5359839Speter#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ 54140614Srwatson#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ 5559839Speter#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ 562729Sdfr#endif 572729Sdfr 5811626Sbde/* Value returned by `fnmatch' if STRING does not match PATTERN. */ 592729Sdfr#define FNM_NOMATCH 1 602729Sdfr 6182607Sdillon/* Match STRING against the filename pattern PATTERN, 62140614Srwatson returning zero if it matches, FNM_NOMATCH if not. */ 6382607Sdillonextern int fnmatch __P ((const char *__pattern, const char *__string, 64129882Sphk int __flags)); 652729Sdfr 6669449Salfred#ifdef __cplusplus 67140839Ssobomax} 6811626Sbde#endif 6959839Speter 7059839Speter#endif /* fnmatch.h */ 7168024Srwatson