Lines Matching refs:pattern
57 match_pattern(const char *s, const char *pattern) in match_pattern() argument
61 if (!*pattern) in match_pattern()
64 if (*pattern == '*') { in match_pattern()
66 pattern++; in match_pattern()
69 if (!*pattern) in match_pattern()
73 if (*pattern != '?' && *pattern != '*') { in match_pattern()
80 if (*s == *pattern && in match_pattern()
81 match_pattern(s + 1, pattern + 1)) in match_pattern()
91 if (match_pattern(s, pattern)) in match_pattern()
104 if (*pattern != '?' && *pattern != *s) in match_pattern()
109 pattern++; in match_pattern()
121 match_pattern_list(const char *string, const char *pattern, int dolower) in match_pattern_list() argument
126 u_int i, subi, len = strlen(pattern); in match_pattern_list()
131 if (pattern[i] == '!') { in match_pattern_list()
142 i < len && subi < sizeof(sub) - 1 && pattern[i] != ','; in match_pattern_list()
144 sub[subi] = dolower && isupper((u_char)pattern[i]) ? in match_pattern_list()
145 tolower((u_char)pattern[i]) : pattern[i]; in match_pattern_list()
151 if (i < len && pattern[i] == ',') in match_pattern_list()
180 match_hostname(const char *host, const char *pattern) in match_hostname() argument
186 r = match_pattern_list(hostcopy, pattern, 1); in match_hostname()
223 const char *pattern) in match_user() argument
230 if ((p = strchr(pattern, '@')) != NULL && in match_user()
236 if ((p = strchr(pattern,'@')) == NULL) in match_user()
237 return match_pattern(user, pattern); in match_user()
239 pat = xstrdup(pattern); in match_user()