Lines Matching refs:pattern
147 pattern_match(match_t MatchType, char *pattern, const char *pkgname)
156 condition = strpbrk(pattern, "<>=");
159 /* yes, isolate the pattern from the condition ... */
160 if (condition > pattern && condition[-1] == '!')
175 errcode = rex_match(pattern, fname, MatchType == MATCH_EREGEX ? 1 : 0);
179 errcode = (csh_match(pattern, fname, 0) == 0) ? 1 : 0;
182 errcode = (strcmp(pattern, fname) == 0) ? 1 : 0;
193 /* restore the pattern */
419 * Returns 1 if specified pkgname matches RE pattern.
424 rex_match(const char *pattern, const char *pkgname, int extended)
433 errcode = regcomp(&rex, pattern, (extended ? REG_EXTENDED : REG_BASIC) | REG_NOSUB);
441 warnx("%s: %s", pattern, errbuf);
451 * Match string by a csh-style glob pattern. Returns 0 on
456 csh_match(const char *pattern, const char *string, int flags)
461 const char *nextchoice = pattern;
489 prefixlen = pos-pattern;
529 snprintf(buf, sizeof(buf), "%.*s%.*s%s", prefixlen, pattern, currentlen, current, postfix);
537 ret = fnmatch(pattern, string, flags);