2
* Copyright (C) 2009 Free Software Foundation, Inc.
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
32
static struct pattern *patlist = NULL;
33
static struct pattern *i_patlist = NULL; /* ISO9660/RR */
34
static struct pattern *j_patlist = NULL; /* Joliet */
36
#define DECL_ADD_MATCH(function, list) \
38
function (char *pattern) \
40
struct pattern *new; \
41
new = malloc (sizeof (*new)); \
42
new->str = strdup (pattern); \
47
DECL_ADD_MATCH (add_match, patlist)
48
DECL_ADD_MATCH (i_add_match, i_patlist)
49
DECL_ADD_MATCH (j_add_match, j_patlist)
51
#define DECL_MATCHES(function, list) \
53
function (char *str) \
56
for (i = list; i != NULL; i = i->next) \
57
if (fnmatch (i->str, str, FNM_FILE_NAME) != FNM_NOMATCH) \
62
DECL_MATCHES (matches, patlist)
63
DECL_MATCHES (i_matches, i_patlist)
64
DECL_MATCHES (j_matches, j_patlist)
69
return (i_patlist != NULL);
75
return (j_patlist != NULL);