26#include <apr_tables.h>
30#define FT_IGNORE_NEGATE 0x01
31#define FT_IGNORE_DIR_ONLY 0x02
apr_status_t ft_ignore_add_pattern_str(ft_ignore_context_t *ctx, const char *pattern_str)
Adds a single pattern string to a context.
ft_ignore_context_t * ft_ignore_context_create(apr_pool_t *pool, ft_ignore_context_t *parent, const char *base_dir)
Creates a new ignore context.
apr_status_t ft_ignore_load_file(ft_ignore_context_t *ctx, const char *filepath)
Loads and parses an ignore file (like .gitignore) into a context.
ft_ignore_match_result_t
Result codes for an ignore match operation.
@ FT_IGNORE_MATCH_NONE
The path is not matched by any pattern.
@ FT_IGNORE_MATCH_WHITELISTED
The path is matched by a negation (whitelist) pattern.
@ FT_IGNORE_MATCH_IGNORED
The path is matched by an ignore pattern.
ft_ignore_match_result_t ft_ignore_match(ft_ignore_context_t *ctx, const char *fullpath, int is_dir)
Checks if a given path should be ignored based on the hierarchical context.
Represents the ignore rules for a specific directory and its descendants.
apr_array_header_t * patterns
Array of ft_ignore_pattern_t pointers defined at this level.
const char * base_dir
The absolute path to the directory this context is anchored to.
struct ft_ignore_context_t * parent
Pointer to the parent directory's context, or NULL if root.
apr_size_t base_dir_len
The length of the base directory path.
apr_pool_t * pool
The memory pool used for allocations within this context.
Represents a single compiled ignore pattern.
unsigned int flags
Flags for the pattern (e.g., FT_IGNORE_NEGATE).
const char * pattern_str
The original, uncompiled pattern string for debugging.
pcre * regex
The compiled PCRE pattern.