Lines Matching refs:mask
26 static int wildcard_match_int(const char *data, const char *mask, bool icase)
28 const char *ma = mask, *na = data, *lsm = NULL, *lsn = NULL;
38 while (*(mask++) != '\0');
39 mask-=2;
44 /* If the mask runs out of chars before the string, fall back on
46 if (mask < ma) {
49 mask = lsm;
58 switch (*mask) {
61 mask--; /* Zap redundant wilds */
62 while ((mask >= ma) && (*mask == WILDS));
63 lsm = mask;
67 if (mask < ma)
71 mask--;
75 if (icase ? (i_toupper(*mask) == i_toupper(*data)) :
76 (*mask == *data)) { /* If matching char */
77 mask--;
84 mask = lsm;
92 while ((mask >= ma) && (*mask == WILDS))
93 mask--; /* Zap leftover %s & *s */
94 return (mask >= ma) ? NOMATCH : MATCH; /* Start of both = match */
97 bool wildcard_match(const char *data, const char *mask)
99 return wildcard_match_int(data, mask, FALSE) != 0;
102 bool wildcard_match_icase(const char *data, const char *mask)
104 return wildcard_match_int(data, mask, TRUE) != 0;