Code

Allow more than true/false to attributes.
[git.git] / attr.h
diff --git a/attr.h b/attr.h
index 1e5ab4069417f184e494a30c7cf821acffafc8d5..8ec2d3d35ce02d15adb0c3b4c72ce2d435d5a1ae 100644 (file)
--- a/attr.h
+++ b/attr.h
@@ -6,9 +6,19 @@ struct git_attr;
 
 struct git_attr *git_attr(const char *, int);
 
+/* Internal use */
+#define ATTR__TRUE     ((void *) 1)
+#define ATTR__FALSE    ((void *) 0)
+#define ATTR__UNSET    ((void *) -1)
+
+/* For public to check git_attr_check results */
+#define ATTR_TRUE(v) ((v) == ATTR__TRUE)
+#define ATTR_FALSE(v) ((v) == ATTR__FALSE)
+#define ATTR_UNSET(v) ((v) == ATTR__UNSET)
+
 struct git_attr_check {
        struct git_attr *attr;
-       int isset;
+       void *value;
 };
 
 int git_checkattr(const char *path, int, struct git_attr_check *);