7b149afdc5b756093b1c4655c80d7c0f49670bcd
[git.git] / cache-tree.h
1 #ifndef CACHE_TREE_H
2 #define CACHE_TREE_H
3
4 struct cache_tree;
5 struct cache_tree_sub {
6         struct cache_tree *cache_tree;
7         int namelen;
8         int used;
9         char name[FLEX_ARRAY];
10 };
11
12 struct cache_tree {
13         int entry_count; /* negative means "invalid" */
14         unsigned char sha1[20];
15         int subtree_nr;
16         int subtree_alloc;
17         struct cache_tree_sub **down;
18 };
19
20 struct cache_tree *cache_tree(void);
21 void cache_tree_free(struct cache_tree *);
22 void cache_tree_invalidate_path(struct cache_tree *, const char *);
23
24 int write_cache_tree(const unsigned char *, struct cache_tree *);
25 struct cache_tree *read_cache_tree(unsigned char *);
26 int cache_tree_update(struct cache_tree *, struct cache_entry **, int, int);
27
28
29 #endif