Lines Matching refs:pattern

9  *  Set in gl_flags if pattern contained a globbing character.
11 * Same as GLOB_NOCHECK, but it will only append pattern if it did
182 const char *pattern,
194 _DIAGASSERT(pattern != NULL);
196 patnext = (const u_char *) pattern;
234 * Expand recursively a glob {} pattern. When there is no more expansion
239 globexp1(const Char *pattern, glob_t *pglob, size_t *limit)
241 const Char* ptr = pattern;
244 _DIAGASSERT(pattern != NULL);
248 if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS)
249 return glob0(pattern, pglob, limit);
252 if (!globexp2(ptr, pattern, pglob, &rv, limit))
255 return glob0(pattern, pglob, limit);
261 * If it succeeds then it invokes globexp1 with the new pattern.
262 * If it fails then it tries to glob the rest of the pattern and returns.
265 globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv,
274 _DIAGASSERT(pattern != NULL);
279 for (lm = patbuf, pm = pattern; pm != ptr; *lm++ = *pm++)
305 /* Non matching braces; just glob the pattern */
308 * we use `pattern', not `patbuf' here so that that
311 *rv = glob0(pattern, pglob, limit);
348 * Append the rest of the pattern after the
354 /* Expand the current pattern */
379 globtilde(const Char *pattern, Char *patbuf, size_t patsize, glob_t *pglob)
389 _DIAGASSERT(pattern != NULL);
393 if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE))
394 return pattern;
397 for (p = pattern + 1, d = (char *)(void *)patbuf;
414 return pattern;
421 return pattern;
431 /* Append the rest of the pattern */
443 * The main glob() routine: compiles the pattern (optionally processing
444 * quotes), calls glob1() to do the real pattern matching, and finally
450 glob0(const Char *pattern, glob_t *pglob, size_t *limit)
457 _DIAGASSERT(pattern != NULL);
460 if ((qpatnext = globtilde(pattern, patbuf, sizeof(patbuf),
523 * If there was no match we are going to append the pattern
525 * specified and the pattern did not contain any magic
532 return globextend(pattern, pglob, limit);
556 glob1(Char *pattern, glob_t *pglob, size_t *limit)
560 _DIAGASSERT(pattern != NULL);
564 if (*pattern == EOS)
571 pathbuf + (sizeof(pathbuf) / sizeof(*pathbuf)) - 1, pattern,
577 * of recursion for each segment in the pattern that contains one or more
581 glob2(Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern, glob_t *pglob,
592 _DIAGASSERT(pattern != NULL);
596 * Loop over pattern segments until end of pattern or until
600 if (*pattern == EOS) { /* End of pattern? */
629 p = pattern;
659 pattern = p;
660 while (*pattern == SEP) {
663 *pathend++ = *pattern++;
666 return glob3(pathbuf, pathend, pathlim, pattern, p,
673 glob3(Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern,
691 _DIAGASSERT(pattern != NULL);
742 if (dp->FileName[0] == DOT && *pattern != DOT)
779 if (!match(pathend, pattern, restpattern)) {
867 * pattern matching function for filenames. Each occurrence of the *
868 * pattern causes a recursion level.