Allow more than true/false to attributes.
[git.git] / attr.h
blob8ec2d3d35ce02d15adb0c3b4c72ce2d435d5a1ae
1 #ifndef ATTR_H
2 #define ATTR_H
4 /* An attribute is a pointer to this opaque structure */
5 struct git_attr;
7 struct git_attr *git_attr(const char *, int);
9 /* Internal use */
10 #define ATTR__TRUE ((void *) 1)
11 #define ATTR__FALSE ((void *) 0)
12 #define ATTR__UNSET ((void *) -1)
14 /* For public to check git_attr_check results */
15 #define ATTR_TRUE(v) ((v) == ATTR__TRUE)
16 #define ATTR_FALSE(v) ((v) == ATTR__FALSE)
17 #define ATTR_UNSET(v) ((v) == ATTR__UNSET)
19 struct git_attr_check {
20 struct git_attr *attr;
21 void *value;
24 int git_checkattr(const char *path, int, struct git_attr_check *);
26 #endif /* ATTR_H */