Lines Matching refs:pattern
46 * Compares a filename or pathname to a pattern.
74 rangematch(const char *pattern, int test, int flags)
79 _DIAGASSERT(pattern != NULL);
88 if ((negate = (*pattern == '!' || *pattern == '^')) != 0)
89 ++pattern;
92 for (ok = 0; (c = FOLDCASE(*pattern++, flags)) != ']' || need;) {
97 c = FOLDCASE(*pattern++, flags);
100 if (*pattern == '-'
101 && (c2 = FOLDCASE(*(pattern + 1), flags)) != EOS &&
103 pattern += 2;
105 c2 = FOLDCASE(*pattern++, flags);
113 return ok == negate ? NULL : pattern;
118 fnmatchx(const char *pattern, const char *string, int flags, size_t recursion)
123 _DIAGASSERT(pattern != NULL);
130 switch (c = FOLDCASE(*pattern++, flags)) {
147 c = FOLDCASE(*pattern, flags);
150 c = FOLDCASE(*++pattern, flags);
157 /* Optimize for pattern with * at end or before /. */
174 switch ((e = fnmatchx(pattern, string,
191 if ((r = rangematch(pattern,
198 pattern = r;
203 if ((c = FOLDCASE(*pattern++, flags)) == EOS) {
205 --pattern;
219 fnmatch(const char *pattern, const char *string, int flags)
221 return fnmatchx(pattern, string, flags, 64);