fnmatch.h revision 169695
1169695Skan/* Copyright 1991, 1992, 1993, 1996 Free Software Foundation, Inc. 2169695Skan 3169695SkanNOTE: The canonical source of this file is maintained with the GNU C Library. 4169695SkanBugs can be reported to bug-glibc@prep.ai.mit.edu. 5169695Skan 6169695SkanThis program is free software; you can redistribute it and/or modify it 7169695Skanunder the terms of the GNU General Public License as published by the 8169695SkanFree Software Foundation; either version 2, or (at your option) any 9169695Skanlater version. 10169695Skan 11169695SkanThis program is distributed in the hope that it will be useful, 12169695Skanbut WITHOUT ANY WARRANTY; without even the implied warranty of 13169695SkanMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14169695SkanGNU General Public License for more details. 15169695Skan 16169695SkanYou should have received a copy of the GNU General Public License 17169695Skanalong with this program; if not, write to the Free Software 18169695SkanFoundation, 51 Franklin Street - Fifth Floor, 19169695SkanBoston, MA 02110-1301, USA. */ 20169695Skan 21169695Skan#ifndef _FNMATCH_H 22169695Skan 23169695Skan#define _FNMATCH_H 1 24169695Skan 25169695Skan#ifdef __cplusplus 26169695Skanextern "C" { 27169695Skan#endif 28169695Skan 29169695Skan#if defined (__cplusplus) || (defined (__STDC__) && __STDC__) 30169695Skan#undef __P 31169695Skan#define __P(args) args 32169695Skan#else /* Not C++ or ANSI C. */ 33169695Skan#undef __P 34169695Skan#define __P(args) () 35169695Skan/* We can get away without defining `const' here only because in this file 36169695Skan it is used only inside the prototype for `fnmatch', which is elided in 37169695Skan non-ANSI C where `const' is problematical. */ 38169695Skan#endif /* C++ or ANSI C. */ 39169695Skan 40169695Skan 41169695Skan/* We #undef these before defining them because some losing systems 42169695Skan (HP-UX A.08.07 for example) define these in <unistd.h>. */ 43169695Skan#undef FNM_PATHNAME 44169695Skan#undef FNM_NOESCAPE 45169695Skan#undef FNM_PERIOD 46169695Skan 47169695Skan/* Bits set in the FLAGS argument to `fnmatch'. */ 48169695Skan#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ 49169695Skan#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ 50169695Skan#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ 51169695Skan 52169695Skan#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE) 53169695Skan#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ 54169695Skan#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ 55169695Skan#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ 56169695Skan#endif 57169695Skan 58169695Skan/* Value returned by `fnmatch' if STRING does not match PATTERN. */ 59169695Skan#define FNM_NOMATCH 1 60169695Skan 61169695Skan/* Match STRING against the filename pattern PATTERN, 62169695Skan returning zero if it matches, FNM_NOMATCH if not. */ 63169695Skanextern int fnmatch __P ((const char *__pattern, const char *__string, 64169695Skan int __flags)); 65169695Skan 66169695Skan#ifdef __cplusplus 67169695Skan} 68169695Skan#endif 69169695Skan 70169695Skan#endif /* fnmatch.h */ 71