Lines Matching refs:pattern

47  *	Set in gl_flags if pattern contained a globbing character.
49 * Same as GLOB_NOCHECK, but it will only append pattern if it did
178 glob(const char *pattern, int flags, int (*errfunc)(const char *, int),
186 if (strnlen(pattern, PATH_MAX) == PATH_MAX)
189 patnext = (u_char *) pattern;
232 * Expand recursively a glob {} pattern. When there is no more expansion
237 globexp1(const Char *pattern, glob_t *pglob, struct glob_lim *limitp)
239 const Char* ptr = pattern;
242 if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS)
243 return glob0(pattern, pglob, limitp);
246 return globexp2(ptr, pattern, pglob, limitp);
248 return glob0(pattern, pglob, limitp);
254 * If it succeeds then it invokes globexp1 with the new pattern.
255 * If it fails then it tries to glob the rest of the pattern and returns.
258 globexp2(const Char *ptr, const Char *pattern, glob_t *pglob,
267 for (lm = patbuf, pm = pattern; pm != ptr; *lm++ = *pm++)
293 /* Non matching braces; just glob the pattern */
331 * Append the rest of the pattern after the
337 /* Expand the current pattern */
363 globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob)
370 if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE))
371 return pattern;
375 for (p = pattern + 1, h = (char *) patbuf;
396 return pattern;
405 return pattern;
414 /* Append the rest of the pattern */
440 const Char *pattern = *patternp + 1;
446 if ((colon = g_strchr(pattern, ':')) == NULL || colon[1] != ']')
449 len = (size_t)(colon - pattern);
451 if (!g_strncmp(pattern, cc->name, len) && cc->name[len] == '\0')
465 * The main glob() routine: compiles the pattern (optionally processing
466 * quotes), calls glob1() to do the real pattern matching, and finally
472 glob0(const Char *pattern, glob_t *pglob, struct glob_lim *limitp)
478 qpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob);
552 * If there was no match we are going to append the pattern
554 * and the pattern did not contain any magic characters
561 return(globextend(pattern, pglob, limitp, NULL));
610 glob1(Char *pattern, Char *pattern_last, glob_t *pglob, struct glob_lim *limitp)
615 if (*pattern == EOS)
619 pattern, pattern_last, pglob, limitp));
624 * of recursion for each segment in the pattern that contains one or more
629 Char *pattern, Char *pattern_last, glob_t *pglob, struct glob_lim *limitp)
636 * Loop over pattern segments until end of pattern or until
640 if (*pattern == EOS) { /* End of pattern? */
669 p = pattern;
680 pattern = p;
681 while (*pattern == SEP) {
684 *pathend++ = *pattern++;
689 pathend_last, pattern, p, pattern_last,
697 Char *pattern, Char *restpattern, Char *restpattern_last, glob_t *pglob,
751 if (dp->d_name[0] == DOT && *pattern != DOT)
763 if (!match(pathend, pattern, restpattern, GLOB_LIMIT_RECUR)) {
896 * pattern matching function for filenames. Each occurrence of the *
897 * pattern causes a recursion level.