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