]> git.proxmox.com Git - libgit2.git/blob - src/index.h
index refactoring
[libgit2.git] / src / index.h
1 /*
2 * Copyright (C) 2009-2012 the libgit2 contributors
3 *
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
6 */
7 #ifndef INCLUDE_index_h__
8 #define INCLUDE_index_h__
9
10 #include "fileops.h"
11 #include "filebuf.h"
12 #include "vector.h"
13 #include "tree-cache.h"
14 #include "git2/odb.h"
15 #include "git2/index.h"
16
17 #define GIT_INDEX_FILE "index"
18 #define GIT_INDEX_FILE_MODE 0666
19
20 struct git_index {
21 git_refcount rc;
22
23 char *index_file_path;
24
25 time_t last_modified;
26 git_vector entries;
27
28 unsigned int on_disk:1;
29
30 unsigned int ignore_case:1;
31 unsigned int distrust_filemode:1;
32 unsigned int no_symlinks:1;
33
34 git_tree_cache *tree;
35
36 git_vector reuc;
37
38 git_vector_cmp entries_cmp_path;
39 git_vector_cmp entries_search;
40 git_vector_cmp entries_search_path;
41 git_vector_cmp reuc_search;
42 };
43
44 extern void git_index__init_entry_from_stat(struct stat *st, git_index_entry *entry);
45
46 extern unsigned int git_index__prefix_position(git_index *index, const char *path);
47
48 #endif