1#ifndef PATHSPEC_H
2#define PATHSPEC_H
34
/* Pathspec magic */
5#define PATHSPEC_FROMTOP (1<<0)
6#define PATHSPEC_ALL_MAGIC PATHSPEC_FROMTOP
78
#define PATHSPEC_ONESTAR 1 /* the pathspec pattern sastisfies GFNM_ONESTAR */
910
struct pathspec {
11const char **raw; /* get_pathspec() result, not freed by free_pathspec() */
12int nr;
13unsigned int has_wildcard:1;
14unsigned int recursive:1;
15unsigned magic;
16int max_depth;
17struct pathspec_item {
18const char *match;
19const char *original;
20unsigned magic;
21int len;
22int nowildcard_len;
23int flags;
24} *items;
25};
2627
/* parse_pathspec flags */
28#define PATHSPEC_PREFER_CWD (1<<0) /* No args means match cwd */
29#define PATHSPEC_PREFER_FULL (1<<1) /* No args means match everything */
3031
extern int init_pathspec(struct pathspec *, const char **);
32extern void parse_pathspec(struct pathspec *pathspec,
33unsigned magic_mask,
34unsigned flags,
35const char *prefix,
36const char **args);
37extern void copy_pathspec(struct pathspec *dst, const struct pathspec *src);
38extern void free_pathspec(struct pathspec *);
3940
extern int limit_pathspec_to_literal(void);
4142
extern char *find_pathspecs_matching_against_index(const char **pathspec);
43extern void add_pathspec_matches_against_index(const char **pathspec, char *seen, int specs);
44extern const char *check_path_for_gitlink(const char *path);
45extern void die_if_path_beyond_symlink(const char *path, const char *prefix);
4647
#endif /* PATHSPEC_H */