5 "@(#)fnmatch.c 8.24 17/08/30 2005-2017 J. Schilling from 8.2 (Berkeley)";
45#if defined(LIBC_SCCS) && !defined(lint)
46static UConst char sccsid[] =
"@(#)fnmatch.c 8.24 (Berkeley) 08/30/17";
77#define RANGE_NOMATCH 0
78#define RANGE_ERROR (-1)
83static int fnmatch1 __PR((
const char *,
const char *,
const char *,
int,
96#if defined(HAVE_PRAGMA_WEAK) && defined(HAVE_LINK_WEAK)
97#pragma weak fnmatch = js_fnmatch
133 const char *stringstart;
138 const char *bt_pattern, *bt_string;
145 bt_pattern = bt_string =
NULL;
148 if (pclen == (
size_t)-1 || pclen == (
size_t)-2)
152 if (sclen == (
size_t)-1 || sclen == (
size_t)-2) {
153 sc = (
unsigned char)*
string;
155 memset(&strmbs, 0,
sizeof (strmbs));
170 (
string == stringstart ||
182 (
string == stringstart ||
206 bt_pattern =
pattern, bt_patmbs = patmbs;
207 bt_string =
string, bt_strmbs = strmbs;
215 (
string == stringstart ||
235 if (pclen == (
size_t)-1 || pclen == (
size_t)-2)
258 if (bt_pattern ==
NULL)
262 if (sclen == (
size_t)-1 ||
263 sclen == (
size_t)-2) {
264 sc = (
unsigned char)*bt_string;
274 pattern = bt_pattern, patmbs = bt_patmbs;
275 string = bt_string, strmbs = bt_strmbs;
299 wchar_t otest =
test;
303 struct xlocale_collate *
table = (
struct xlocale_collate *)
304 __get_locale()->components[XLC_COLLATE];
342 if (pclen == (
size_t)-1 || pclen == (
size_t)-2)
346 if (!quoted &&
c ==
'[') {
356 if (*
p ==
':' &&
p[1] ==
']')
372 if (
strcmp(
class,
"upper") == 0)
376 else if (
strcmp(
class,
"lower") == 0)
394 if (pclen == (
size_t)-1 || pclen == (
size_t)-2)
404 if (
table->__collate_load_error ?
406 __wcollate_range_cmp(
c,
test) <= 0 &&
407 __wcollate_range_cmp(
test, c2) <= 0)
413 }
else if (
c ==
test)
_Tp _STLP_CALL norm(const complex< _Tp > &__z)
int strcmp(const char *String1, const char *String2)
char * strchr(const char *String, int ch)
int js_fnmatch(char *pattern, const char *string, int flags) const
static int fnmatch1(char *pattern, const char *string, const char *stringstart, int flags, mbstate_t patmbs, mbstate_t strmbs) const
static UConst char sccsid[]
static int rangematch(char *pattern, wchar_t test, int flags, char **newp, mbstate_t *patmbs) const
int __cdecl iswctype(wint_t wc, wctype_t wctypeFlags)
wctype_t __cdecl wctype(const char *)