X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fexclude.c;h=1925a398a01c42e275d56a8eb9b8722031e54670;hb=daa689ebb8beb42e803445c882f20a175eb51b7f;hp=e5cdfc34b9bdcef8d5f0217dcb2db77ad6eddf55;hpb=8a89b026847b0a27d5b9031490f646937eb3da20;p=gnulib.git diff --git a/lib/exclude.c b/lib/exclude.c index e5cdfc34b..1925a398a 100644 --- a/lib/exclude.c +++ b/lib/exclude.c @@ -1,5 +1,5 @@ /* exclude.c -- exclude file names - Copyright 1992, 1993, 1994, 1997 Free Software Foundation, Inc. + Copyright 1992, 1993, 1994, 1997, 1999, 2000 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,8 +31,8 @@ extern int errno; #include #include -void *xmalloc __EXCLUDE_P ((size_t)); -void *xrealloc __EXCLUDE_P ((void *, size_t)); +void *xmalloc PARAMS ((size_t)); +void *xrealloc PARAMS ((void *, size_t)); /* Keep track of excluded file name patterns. */ @@ -43,8 +43,6 @@ struct exclude int exclude_count; }; -/* FIXME: describe */ - struct exclude * new_exclude (void) { @@ -55,24 +53,20 @@ new_exclude (void) return ex; } -/* FIXME: describe */ - int -excluded_filename (struct exclude const *ex, char const *f) +excluded_filename (struct exclude const *ex, char const *f, int options) { char const * const *exclude = ex->exclude; int exclude_count = ex->exclude_count; int i; for (i = 0; i < exclude_count; i++) - if (fnmatch (exclude[i], f, 0) == 0) + if (fnmatch (exclude[i], f, options) == 0) return 1; return 0; } -/* FIXME: describe */ - void add_exclude (struct exclude *ex, char const *pattern) { @@ -84,10 +78,9 @@ add_exclude (struct exclude *ex, char const *pattern) ex->exclude[ex->exclude_count++] = pattern; } -/* FIXME: describe */ - int -add_exclude_file (struct exclude *ex, char const *filename, char line_end) +add_exclude_file (void (*add_func) PARAMS ((struct exclude *, char const *)), + struct exclude *ex, char const *filename, char line_end) { int use_stdin = filename[0] == '-' && !filename[1]; FILE *in; @@ -126,7 +119,7 @@ add_exclude_file (struct exclude *ex, char const *filename, char line_end) if (p < lim ? *p == line_end : buf < p && p[-1]) { *p = '\0'; - add_exclude (ex, pattern); + (*add_func) (ex, pattern); pattern = p + 1; }