Blame lib/exclude.h

Packit 33f14e
/* exclude.h -- declarations for excluding file names
Packit 33f14e
Packit 33f14e
   Copyright (C) 1992-1994, 1997, 1999, 2001-2003, 2005-2006, 2009-2017 Free
Packit 33f14e
   Software Foundation, Inc.
Packit 33f14e
Packit 33f14e
   This program is free software: you can redistribute it and/or modify
Packit 33f14e
   it under the terms of the GNU General Public License as published by
Packit 33f14e
   the Free Software Foundation; either version 3 of the License, or
Packit 33f14e
   (at your option) any later version.
Packit 33f14e
Packit 33f14e
   This program is distributed in the hope that it will be useful,
Packit 33f14e
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 33f14e
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 33f14e
   GNU General Public License for more details.
Packit 33f14e
Packit 33f14e
   You should have received a copy of the GNU General Public License
Packit 33f14e
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit 33f14e
Packit 33f14e
#ifndef _GL_EXCLUDE_H
Packit 33f14e
#define _GL_EXCLUDE_H 1
Packit 33f14e
Packit 33f14e
#include <stdbool.h>
Packit 33f14e
#include <stdio.h>
Packit 33f14e
Packit 33f14e
/* Written by Paul Eggert <eggert@twinsun.com>
Packit 33f14e
   and Sergey Poznyakoff <gray@gnu.org> */
Packit 33f14e
Packit 33f14e
/* Exclude options, which can be ORed with fnmatch options.  */
Packit 33f14e
Packit 33f14e
/* Patterns must match the start of file names, instead of matching
Packit 33f14e
   anywhere after a '/'.  */
Packit 33f14e
#define EXCLUDE_ANCHORED (1 << 30)
Packit 33f14e
Packit 33f14e
/* Include instead of exclude.  */
Packit 33f14e
#define EXCLUDE_INCLUDE (1 << 29)
Packit 33f14e
Packit 33f14e
/* '?', '*', '[', and '\\' are special in patterns.  Without this
Packit 33f14e
   option, these characters are ordinary and fnmatch is not used.  */
Packit 33f14e
#define EXCLUDE_WILDCARDS (1 << 28)
Packit 33f14e
Packit 33f14e
/* Patterns are POSIX extended regular expressions */
Packit 33f14e
#define EXCLUDE_REGEX     (1 << 27)
Packit 33f14e
Packit 33f14e
/* Allocate storage for the pattern */
Packit 33f14e
#define EXCLUDE_ALLOC     (1 << 26)
Packit 33f14e
Packit 33f14e
struct exclude;
Packit 33f14e
Packit 33f14e
bool fnmatch_pattern_has_wildcards (const char *, int) _GL_ATTRIBUTE_PURE;
Packit 33f14e
Packit 33f14e
struct exclude *new_exclude (void);
Packit 33f14e
void free_exclude (struct exclude *);
Packit 33f14e
void add_exclude (struct exclude *, char const *, int);
Packit 33f14e
int add_exclude_file (void (*) (struct exclude *, char const *, int),
Packit 33f14e
                      struct exclude *, char const *, int, char);
Packit 33f14e
int add_exclude_fp (void (*) (struct exclude *, char const *, int, void *),
Packit 33f14e
		    struct exclude *, FILE *, int, char, void *);
Packit 33f14e
bool excluded_file_name (struct exclude const *, char const *);
Packit 33f14e
void exclude_add_pattern_buffer (struct exclude *ex, char *buf);
Packit 33f14e
bool exclude_fnmatch (char const *, char const *, int);
Packit 33f14e
Packit 33f14e
#endif /* _GL_EXCLUDE_H */