Fix some "implicit declaration of function" warnings
[libgit2.git] / src / index.h
blob5d7c572f027d5926759b45c105659791f66a7014
1 #ifndef INCLUDE_index_h__
2 #define INCLUDE_index_h__
4 #include "fileops.h"
5 #include "filelock.h"
6 #include "git/odb.h"
7 #include "git/index.h"
9 #define GIT_IDXENTRY_NAMEMASK (0x0fff)
10 #define GIT_IDXENTRY_STAGEMASK (0x3000)
11 #define GIT_IDXENTRY_EXTENDED (0x4000)
12 #define GIT_IDXENTRY_VALID (0x8000)
13 #define GIT_IDXENTRY_STAGESHIFT 12
15 typedef struct {
16 uint32_t seconds;
17 uint32_t nanoseconds;
18 } git_index_time;
20 struct git_index_entry {
21 git_index_time ctime;
22 git_index_time mtime;
24 uint32_t dev;
25 uint32_t ino;
26 uint32_t mode;
27 uint32_t uid;
28 uint32_t gid;
29 uint32_t file_size;
31 git_oid oid;
33 uint16_t flags;
34 uint16_t flags_extended;
36 char *path;
40 struct git_index_tree {
41 char *name;
43 struct git_index_tree *parent;
44 struct git_index_tree **children;
45 size_t children_count;
47 size_t entries;
48 git_oid oid;
51 typedef struct git_index_tree git_index_tree;
53 struct git_index {
55 char *index_file_path;
56 time_t last_modified;
58 git_index_entry *entries;
59 unsigned int entries_size;
61 unsigned int entry_count;
62 unsigned int sorted:1,
63 on_disk:1;
65 git_index_tree *tree;
69 extern int git_index__write(git_index *index, git_filelock *file);
70 extern void git_index__sort(git_index *index);
72 #endif