ignore.h File Reference

ignore patterns header file. More...

#include "global.h"
#include "actions.h"

Include dependency graph for ignore.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  grouping_t
 Group structure. More...

Defines

#define hlp_ignore   hlp_groups
 For the help text.
Where a new pattern should be inserted.
#define PATTERN_POSITION_START   (0)
 At the front.
#define PATTERN_POSITION_END   (-1)
 Behind all other patterns (appended).
#define HAVE_DIR   1
 List of bits for pattern definitons.
#define HAVE_CASE   2
#define HAVE_GROUP   4
#define HAVE_MODE   8
#define HAVE_PATTERN   16
#define HAVE_PATTERN_SUBST   32

Enumerations

enum  { FORCE_IGNORE = 0, ALLOW_GROUPS }

Functions

int ign__new_pattern (unsigned count, char *pattern[], char *ends, int user_pattern, int position)
 Adds a list of new ignore patterns to the internal list.
int ign__is_ignore (struct estat *sts, int *is_ignored)
 Tells whether the given entry is to be ignored.
int ign__load_list (char *dir)
 Loads the ignore list from the WAA.
int ign__print_group_stats (FILE *output)
 Print the grouping statistics.

Variables

int ign__max_group_name_len
 The length of the longest group name, used for status.
work_t ign__work
 Ignore command main function.
work_t ign__rign
 Rel-ignore command main function.


Detailed Description

ignore patterns header file.

Definition in file ignore.h.


Define Documentation

#define HAVE_CASE   2

Definition at line 65 of file ignore.h.

Referenced by ign___init_pattern_into().

#define HAVE_DIR   1

List of bits for pattern definitons.

Definition at line 64 of file ignore.h.

Referenced by ign___init_pattern_into().

#define HAVE_GROUP   4

Definition at line 66 of file ignore.h.

Referenced by ign___init_pattern_into(), and ign__work().

#define HAVE_MODE   8

Definition at line 67 of file ignore.h.

Referenced by ign___init_pattern_into().

#define HAVE_PATTERN   16

Definition at line 68 of file ignore.h.

Referenced by ign___init_pattern_into().

#define HAVE_PATTERN_SUBST   32

Definition at line 69 of file ignore.h.

Referenced by ign___init_pattern_into().

#define hlp_ignore   hlp_groups

For the help text.

Definition at line 74 of file ignore.h.

#define PATTERN_POSITION_END   (-1)

Behind all other patterns (appended).

Definition at line 23 of file ignore.h.

Referenced by ign___parse_position(), ign__load_list(), ign__new_pattern(), and ign__work().

#define PATTERN_POSITION_START   (0)

At the front.

Definition at line 21 of file ignore.h.

Referenced by ign___parse_position().


Enumeration Type Documentation

anonymous enum

Enumerator:
FORCE_IGNORE 
ALLOW_GROUPS 

Definition at line 57 of file ignore.h.


Function Documentation

int ign__is_ignore ( struct estat sts,
int *  is_ignored 
)

Tells whether the given entry is to be ignored.

Tells whether the given entry is to be ignored.

Searches this entry for a take/ignore pattern.

If a parent directory has an ignore entry which might be valid for this directory (like **/*~), it is mentioned in this directory, too - in case of something like dir/a*/b*/* a path level value is given.

As we need to preserve the _order_ of the ignore/take statements, we cannot easily optimize. is_ignored is set to +1 if ignored, 0 if unknown, and -1 if on a take-list (overriding later ignore list).

sts must already have the correct estat::st.mode bits set.

Definition at line 1612 of file ignore.c.

References BUG, ignore_t::compare, ignore_t::compiled, DEBUGP, ignore_t::dev, sstat_t::dev, dir___f_sort_by_inodePP(), ignore_t::dir_only, ignore_t::extra, ignore_t::group_def, ign___compare_dev(), ign___load_group(), sstat_t::ino, ignore_t::inode, grouping_t::is_ignore, estat::match_pattern, sstat_t::mode, ignore_t::mode_match_and, ignore_t::mode_match_cmp, ops__build_path(), estat::parent, PAT_DEV__EQUAL, PAT_DEV__GREATER, PAT_DEV__LESS, estat::path_len, ignore_t::pattern, PT_DEVICE, PT_INODE, PT_PCRE, PT_SHELL, PT_SHELL_ABS, estat::st, ignore_t::stats_matches, ignore_t::stats_tested, STOPIF, STOPIF_CODE_ERR, estat::to_be_ignored, ignore_t::type, UNUSED, and used_ignore_entries.

Referenced by au__action(), prp__s_work(), st__status(), waa__build_tree(), and waa__update_dir().

Here is the call graph for this function:

Here is the caller graph for this function:

int ign__load_list ( char *  dir  ) 

Loads the ignore list from the WAA.

Definition at line 1282 of file ignore.c.

References DEBUGP, ign__new_pattern(), ign_header_str, memory, PATTERN_POSITION_END, STOPIF, STOPIF_CODE_ERR, used_ignore_entries, WAA__IGNORE_EXT, waa__open_byext(), and WAA__READ.

Referenced by au__prepare_for_added(), ci__work(), df__work(), ign__rign(), ign__work(), and st__work().

Here is the call graph for this function:

Here is the caller graph for this function:

int ign__new_pattern ( unsigned  count,
char *  pattern[],
char *  ends,
int  user_pattern,
int  position 
)

Adds a list of new ignore patterns to the internal list.

Definition at line 1807 of file ignore.c.

References BUG_ON, DEBUGP, hlp__realloc(), ign___init_pattern_into(), ignore_t::is_user_pat, max_ignore_entries, PATTERN_POSITION_END, RESERVE_IGNORE_ENTRIES, STOPIF, and used_ignore_entries.

Referenced by ign__load_list(), ign__rign(), and ign__work().

Here is the call graph for this function:

Here is the caller graph for this function:

int ign__print_group_stats ( FILE *  output  ) 

Print the grouping statistics.

Definition at line 1983 of file ignore.c.

References ignore_t::group_name, ignore_t::is_user_pat, opt__is_verbose(), ignore_t::pattern, ignore_t::stats_matches, ignore_t::stats_tested, STOPIF_CODE_EPIPE, and used_ignore_entries.

Referenced by ign__work(), and st__work().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

The length of the longest group name, used for status.

This is initialized to 6, because "ignore" at least takes that much space - and "(none)" too.

Definition at line 611 of file ignore.c.

Referenced by ign___init_pattern_into(), and st__print_status().

work_t ign__rign

Rel-ignore command main function.

Definition at line 43 of file ignore.h.

work_t ign__work

Ignore command main function.

Definition at line 41 of file ignore.h.


Generated for fsvs by  doxygen 1.5.9