convert some get_pathspec() calls to parse_pathspec()
[git/git.git] / pathspec.h
CommitLineData
6f525e71
AS
1#ifndef PATHSPEC_H
2#define PATHSPEC_H
3
87323bda
NTND
4/* Pathspec magic */
5#define PATHSPEC_FROMTOP (1<<0)
6#define PATHSPEC_ALL_MAGIC PATHSPEC_FROMTOP
7
64acde94
NTND
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;
87323bda 15 unsigned magic;
64acde94
NTND
16 int max_depth;
17 struct pathspec_item {
18 const char *match;
d2ce1331 19 const char *original;
87323bda 20 unsigned magic;
64acde94
NTND
21 int len;
22 int nowildcard_len;
23 int flags;
24 } *items;
25};
26
fc12261f
NTND
27/* 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 */
30
64acde94 31extern int init_pathspec(struct pathspec *, const char **);
87323bda
NTND
32extern void parse_pathspec(struct pathspec *pathspec,
33 unsigned magic_mask,
34 unsigned flags,
35 const char *prefix,
36 const char **args);
e4d92cdc 37extern void copy_pathspec(struct pathspec *dst, const struct pathspec *src);
64acde94
NTND
38extern void free_pathspec(struct pathspec *);
39
40extern int limit_pathspec_to_literal(void);
41
4b78d7bc
AS
42extern char *find_pathspecs_matching_against_index(const char **pathspec);
43extern void add_pathspec_matches_against_index(const char **pathspec, char *seen, int specs);
9d67b61f 44extern const char *check_path_for_gitlink(const char *path);
512aaf94 45extern void die_if_path_beyond_symlink(const char *path, const char *prefix);
6f525e71
AS
46
47#endif /* PATHSPEC_H */