1*53ee8cc1Swenshuai.xi /* Copyright (C) 1991-93,96,97,98,99,2001,2004 Free Software Foundation, Inc. 2*53ee8cc1Swenshuai.xi This file is part of the GNU C Library. 3*53ee8cc1Swenshuai.xi 4*53ee8cc1Swenshuai.xi The GNU C Library is free software; you can redistribute it and/or 5*53ee8cc1Swenshuai.xi modify it under the terms of the GNU Lesser General Public 6*53ee8cc1Swenshuai.xi License as published by the Free Software Foundation; either 7*53ee8cc1Swenshuai.xi version 2.1 of the License, or (at your option) any later version. 8*53ee8cc1Swenshuai.xi 9*53ee8cc1Swenshuai.xi The GNU C Library is distributed in the hope that it will be useful, 10*53ee8cc1Swenshuai.xi but WITHOUT ANY WARRANTY; without even the implied warranty of 11*53ee8cc1Swenshuai.xi MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12*53ee8cc1Swenshuai.xi Lesser General Public License for more details. 13*53ee8cc1Swenshuai.xi 14*53ee8cc1Swenshuai.xi You should have received a copy of the GNU Lesser General Public 15*53ee8cc1Swenshuai.xi License along with the GNU C Library; if not, write to the Free 16*53ee8cc1Swenshuai.xi Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 17*53ee8cc1Swenshuai.xi 02111-1307 USA. */ 18*53ee8cc1Swenshuai.xi 19*53ee8cc1Swenshuai.xi #ifndef _FNMATCH_H 20*53ee8cc1Swenshuai.xi #define _FNMATCH_H 1 21*53ee8cc1Swenshuai.xi 22*53ee8cc1Swenshuai.xi #ifdef __cplusplus 23*53ee8cc1Swenshuai.xi extern "C" { 24*53ee8cc1Swenshuai.xi #endif 25*53ee8cc1Swenshuai.xi 26*53ee8cc1Swenshuai.xi #ifndef const 27*53ee8cc1Swenshuai.xi # if (defined __STDC__ && __STDC__) || defined __cplusplus 28*53ee8cc1Swenshuai.xi # define __const const 29*53ee8cc1Swenshuai.xi # else 30*53ee8cc1Swenshuai.xi # define __const 31*53ee8cc1Swenshuai.xi # endif 32*53ee8cc1Swenshuai.xi #endif 33*53ee8cc1Swenshuai.xi 34*53ee8cc1Swenshuai.xi /* We #undef these before defining them because some losing systems 35*53ee8cc1Swenshuai.xi (HP-UX A.08.07 for example) define these in <unistd.h>. */ 36*53ee8cc1Swenshuai.xi #undef FNM_PATHNAME 37*53ee8cc1Swenshuai.xi #undef FNM_NOESCAPE 38*53ee8cc1Swenshuai.xi #undef FNM_PERIOD 39*53ee8cc1Swenshuai.xi 40*53ee8cc1Swenshuai.xi /* Bits set in the FLAGS argument to `fnmatch'. */ 41*53ee8cc1Swenshuai.xi #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */ 42*53ee8cc1Swenshuai.xi #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ 43*53ee8cc1Swenshuai.xi #define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */ 44*53ee8cc1Swenshuai.xi 45*53ee8cc1Swenshuai.xi #if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE 46*53ee8cc1Swenshuai.xi # define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ 47*53ee8cc1Swenshuai.xi # define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ 48*53ee8cc1Swenshuai.xi # define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ 49*53ee8cc1Swenshuai.xi # define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */ 50*53ee8cc1Swenshuai.xi #endif 51*53ee8cc1Swenshuai.xi 52*53ee8cc1Swenshuai.xi /* Value returned by `fnmatch' if STRING does not match PATTERN. */ 53*53ee8cc1Swenshuai.xi #define FNM_NOMATCH 1 54*53ee8cc1Swenshuai.xi 55*53ee8cc1Swenshuai.xi /* This value is returned if the implementation does not support 56*53ee8cc1Swenshuai.xi `fnmatch'. Since this is not the case here it will never be 57*53ee8cc1Swenshuai.xi returned but the conformance test suites still require the symbol 58*53ee8cc1Swenshuai.xi to be defined. */ 59*53ee8cc1Swenshuai.xi #ifdef _XOPEN_SOURCE 60*53ee8cc1Swenshuai.xi # define FNM_NOSYS (-1) 61*53ee8cc1Swenshuai.xi #endif 62*53ee8cc1Swenshuai.xi 63*53ee8cc1Swenshuai.xi /* Match NAME against the filename pattern PATTERN, 64*53ee8cc1Swenshuai.xi returning zero if it matches, FNM_NOMATCH if not. */ 65*53ee8cc1Swenshuai.xi extern int fnmatch (__const char *__pattern, __const char *__name, 66*53ee8cc1Swenshuai.xi int __flags); 67*53ee8cc1Swenshuai.xi 68*53ee8cc1Swenshuai.xi #ifdef __cplusplus 69*53ee8cc1Swenshuai.xi } 70*53ee8cc1Swenshuai.xi #endif 71*53ee8cc1Swenshuai.xi 72*53ee8cc1Swenshuai.xi #endif /* fnmatch.h */ 73