1 module deimos.git2.attr;
2 
3 import deimos.git2.common;
4 import deimos.git2.types;
5 import deimos.git2.util;
6 
7 extern (C):
8 
9 bool GIT_ATTR_TRUE(T)(T attr) { return git_attr_value(attr) == git_attr_t.GIT_ATTR_TRUE_T; }
10 bool GIT_ATTR_FALSE(T)(T attr) { return git_attr_value(attr) == git_attr_t.GIT_ATTR_FALSE_T; }
11 bool GIT_ATTR_UNSPECIFIED(T)(T attr) { return git_attr_value(attr) == git_attr_t.GIT_ATTR_UNSPECIFIED_T; }
12 bool GIT_ATTR_HAS_VALUE(T)(T attr) { return git_attr_value(attr) == git_attr_t.GIT_ATTR_VALUE_T; }
13 
14 enum git_attr_t
15 {
16     GIT_ATTR_UNSPECIFIED_T = 0,
17     GIT_ATTR_TRUE_T,
18     GIT_ATTR_FALSE_T,
19     GIT_ATTR_VALUE_T,
20 }
21 mixin _ExportEnumMembers!git_attr_t;
22 
23 git_attr_t git_attr_value(const(char)* attr);
24 
25 enum GIT_ATTR_CHECK_FILE_THEN_INDEX	= 0;
26 enum GIT_ATTR_CHECK_INDEX_THEN_FILE	= 1;
27 enum GIT_ATTR_CHECK_INDEX_ONLY      = 2;
28 enum GIT_ATTR_CHECK_NO_SYSTEM = 1 << 2;
29 
30 int git_attr_get(
31 	const(char)** value_out,
32 	git_repository *repo,
33 	uint32_t flags,
34 	const(char)* path,
35 	const(char)* name);
36 int git_attr_get_many(
37 	const(char)** values_out,
38 	git_repository *repo,
39 	uint32_t flags,
40 	const(char)* path,
41 	size_t num_attr,
42 	const(char)** names);
43 
44 alias git_attr_foreach_cb = int function(const(char)* name, const(char)* value, void *payload);
45 
46 int git_attr_foreach(
47 	git_repository *repo,
48 	uint32_t flags,
49 	const(char)* path,
50 	git_attr_foreach_cb callback,
51 	void *payload);
52 void git_attr_cache_flush(
53 	git_repository *repo);
54 int git_attr_add_macro(
55 	git_repository *repo,
56 	const(char)* name,
57 	const(char)* values);