• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/Heimdal-398.1.2/lib/roken/

Lines Matching defs:pattern

44  *	Set in gl_flags if pattern contained a globbing character.
46 * Same as GLOB_NOCHECK, but it will only append pattern if it did
168 glob(const char *pattern,
177 patnext = (const u_char *) pattern;
215 * Expand recursively a glob {} pattern. When there is no more expansion
219 static int globexp1(const Char *pattern, glob_t *pglob)
221 const Char* ptr = pattern;
225 if (pattern[0] == CHAR_LBRACE && pattern[1] == CHAR_RBRACE && pattern[2] == CHAR_EOS)
226 return glob0(pattern, pglob);
229 if (!globexp2(ptr, pattern, pglob, &rv))
232 return glob0(pattern, pglob);
238 * If it succeeds then it invokes globexp1 with the new pattern.
239 * If it fails then it tries to glob the rest of the pattern and returns.
241 static int globexp2(const Char *ptr, const Char *pattern,
250 for (lm = patbuf, pm = pattern; pm != ptr; *lm++ = *pm++)
276 /* Non matching braces; just glob the pattern */
315 * Append the rest of the pattern after the
321 /* Expand the current pattern */
345 globtilde(const Char *pattern, Char *patbuf, glob_t *pglob)
352 if (*pattern != CHAR_TILDE || !(pglob->gl_flags & GLOB_TILDE))
353 return pattern;
356 for (p = pattern + 1, h = (char *) patbuf; *p && *p != CHAR_SLASH;
369 return pattern;
379 return pattern;
388 /* Append the rest of the pattern */
397 * The main glob() routine: compiles the pattern (optionally processing
398 * quotes), calls glob1() to do the real pattern matching, and finally
404 glob0(const Char *pattern, glob_t *pglob)
411 qpatnext = globtilde(pattern, patbuf, pglob);
471 * If there was no match we are going to append the pattern
473 * and the pattern did not contain any magic characters
480 return(globextend(pattern, pglob, &limit));
494 glob1(Char *pattern, glob_t *pglob, size_t *limit)
499 if (*pattern == CHAR_EOS)
501 return(glob2(pathbuf, pathbuf, pattern, pglob, limit));
506 * of recursion for each segment in the pattern that contains one or more
519 glob2(Char *pathbuf, Char *pathend, Char *pattern, glob_t *pglob,
527 * Loop over pattern segments until end of pattern or until
531 if (*pattern == CHAR_EOS) { /* End of pattern? */
550 p = pattern;
559 pattern = p;
560 while (*pattern == CHAR_SEP)
561 *pathend++ = *pattern++;
563 return(glob3(pathbuf, pathend, pattern, p, pglob,
570 glob3(Char *pathbuf, Char *pathend, Char *pattern, Char *restpattern,
612 if (dp->d_name[0] == CHAR_DOT && *pattern != CHAR_DOT)
617 if (!match(pathend, pattern, restpattern)) {
692 * pattern matching function for filenames. Each occurrence of the *
693 * pattern causes a recursion level.