4 /* An attribute is a pointer to this opaque structure */
7 /* opaque structure used internally for attribute collection */
11 * Given a string, return the gitattribute object that
14 struct git_attr
*git_attr(const char *);
17 extern const char git_attr__true
[];
18 extern const char git_attr__false
[];
20 /* For public to check git_attr_check results */
21 #define ATTR_TRUE(v) ((v) == git_attr__true)
22 #define ATTR_FALSE(v) ((v) == git_attr__false)
23 #define ATTR_UNSET(v) ((v) == NULL)
26 * Send one or more git_attr_check to git_check_attrs(), and
27 * each 'value' member tells what its value is.
28 * Unset one is returned as NULL.
30 struct attr_check_item
{
31 const struct git_attr
*attr
;
38 struct attr_check_item
*items
;
40 struct all_attrs_item
*all_attrs
;
43 extern struct attr_check
*attr_check_alloc(void);
44 extern struct attr_check
*attr_check_initl(const char *, ...);
46 extern struct attr_check_item
*attr_check_append(struct attr_check
*check
,
47 const struct git_attr
*attr
);
49 extern void attr_check_reset(struct attr_check
*check
);
50 extern void attr_check_clear(struct attr_check
*check
);
51 extern void attr_check_free(struct attr_check
*check
);
54 * Return the name of the attribute represented by the argument. The
55 * return value is a pointer to a null-delimited string that is part
56 * of the internal data structure; it should not be modified or freed.
58 extern const char *git_attr_name(const struct git_attr
*);
60 extern int git_check_attr(const char *path
, struct attr_check
*check
);
63 * Retrieve all attributes that apply to the specified path.
64 * check holds the attributes and their values.
66 extern void git_all_attrs(const char *path
, struct attr_check
*check
);
68 enum git_attr_direction
{
73 void git_attr_set_direction(enum git_attr_direction
, struct index_state
*);
75 extern void attr_start(void);