attr: rename function and struct related to checking attributes
The traditional API to check attributes is to prepare an N-element array of "struct git_attr_check" and pass N and the array to the function "git_check_attr()" as arguments. In preparation to revamp the API to pass a single structure, in which these N elements are held, rename the type used for these individual array elements to "struct attr_check_item" and rename the function to "git_check_attrs()". Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
8
attr.h
8
attr.h
@ -20,11 +20,11 @@ extern const char git_attr__false[];
|
||||
#define ATTR_UNSET(v) ((v) == NULL)
|
||||
|
||||
/*
|
||||
* Send one or more git_attr_check to git_check_attr(), and
|
||||
* Send one or more git_attr_check to git_check_attrs(), and
|
||||
* each 'value' member tells what its value is.
|
||||
* Unset one is returned as NULL.
|
||||
*/
|
||||
struct git_attr_check {
|
||||
struct attr_check_item {
|
||||
const struct git_attr *attr;
|
||||
const char *value;
|
||||
};
|
||||
@ -36,7 +36,7 @@ struct git_attr_check {
|
||||
*/
|
||||
extern const char *git_attr_name(const struct git_attr *);
|
||||
|
||||
int git_check_attr(const char *path, int, struct git_attr_check *);
|
||||
int git_check_attrs(const char *path, int, struct attr_check_item *);
|
||||
|
||||
/*
|
||||
* Retrieve all attributes that apply to the specified path. *num
|
||||
@ -45,7 +45,7 @@ int git_check_attr(const char *path, int, struct git_attr_check *);
|
||||
* objects describing the attributes and their values. *check must be
|
||||
* free()ed by the caller.
|
||||
*/
|
||||
int git_all_attrs(const char *path, int *num, struct git_attr_check **check);
|
||||
int git_all_attrs(const char *path, int *num, struct attr_check_item **check);
|
||||
|
||||
enum git_attr_direction {
|
||||
GIT_ATTR_CHECKIN,
|
||||
|
Reference in New Issue
Block a user