• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/libarchive-30/libarchive/libarchive_fe/

Lines Matching refs:match

44 struct match {
45 struct match *next;
51 struct match *exclusions;
53 struct match *inclusions;
58 static void add_pattern(struct match **list, const char *pattern);
60 static int match_exclusion(struct match *, const char *pathname);
61 static int match_inclusion(struct match *, const char *pathname);
131 add_pattern(struct match **list, const char *pattern)
133 struct match *match;
137 match = malloc(sizeof(*match) + len + 1);
138 if (match == NULL)
140 strcpy(match->pattern, pattern);
141 /* Both "foo/" and "foo" should match "foo/bar". */
142 if (len && match->pattern[len - 1] == '/')
143 match->pattern[strlen(match->pattern)-1] = '\0';
144 match->next = *list;
145 *list = match;
146 match->matches = 0;
153 struct match *match;
154 struct match *matched;
160 for (match = matching->exclusions; match != NULL; match = match->next){
161 if (match_exclusion(match, pathname))
167 for (match = matching->inclusions; match != NULL; match = match->next){
168 if (match_inclusion(match, pathname)) {
173 if (match->matches == 0) {
174 match->matches++;
179 * Otherwise, remember the match but keep checking
182 matched = match;
187 * we did find a match, so count it and exit.
198 /* No explicit inclusions, default is to match. */
204 * gtar. In particular, 'a*b' will match 'foo/a1111/222b/bar'
208 match_exclusion(struct match *match, const char *pathname)
210 return (lafe_pathmatch(match->pattern,
216 * Again, mimic gtar: inclusions are always anchored (have to match
220 match_inclusion(struct match *match, const char *pathname)
223 return (lafe_pathmatch(match->pattern, pathname, 0));
225 return (lafe_pathmatch(match->pattern, pathname, PATHMATCH_NO_ANCHOR_END));
232 struct match *p, *q;
273 struct match *p;