937ec91a0d28e885f9e113d8dcbfd0b3a7e98276
   1#ifndef PATHSPEC_H
   2#define PATHSPEC_H
   3
   4/* Pathspec magic */
   5#define PATHSPEC_FROMTOP        (1<<0)
   6#define PATHSPEC_ALL_MAGIC PATHSPEC_FROMTOP
   7
   8#define PATHSPEC_ONESTAR 1      /* the pathspec pattern sastisfies GFNM_ONESTAR */
   9
  10struct pathspec {
  11        const char **raw; /* get_pathspec() result, not freed by free_pathspec() */
  12        int nr;
  13        unsigned int has_wildcard:1;
  14        unsigned int recursive:1;
  15        unsigned magic;
  16        int max_depth;
  17        struct pathspec_item {
  18                const char *match;
  19                unsigned magic;
  20                int len;
  21                int nowildcard_len;
  22                int flags;
  23        } *items;
  24};
  25
  26extern int init_pathspec(struct pathspec *, const char **);
  27extern void parse_pathspec(struct pathspec *pathspec,
  28                           unsigned magic_mask,
  29                           unsigned flags,
  30                           const char *prefix,
  31                           const char **args);
  32extern void copy_pathspec(struct pathspec *dst, const struct pathspec *src);
  33extern void free_pathspec(struct pathspec *);
  34
  35extern int limit_pathspec_to_literal(void);
  36
  37extern char *find_pathspecs_matching_against_index(const char **pathspec);
  38extern void add_pathspec_matches_against_index(const char **pathspec, char *seen, int specs);
  39extern const char *check_path_for_gitlink(const char *path);
  40extern void die_if_path_beyond_symlink(const char *path, const char *prefix);
  41
  42#endif /* PATHSPEC_H */