8 struct cache_tree_sub {
9 struct cache_tree *cache_tree;
12 char name[FLEX_ARRAY];
16 int entry_count; /* negative means "invalid" */
17 unsigned char sha1[20];
20 struct cache_tree_sub **down;
23 struct cache_tree *cache_tree(void);
24 void cache_tree_free(struct cache_tree **);
25 void cache_tree_invalidate_path(struct cache_tree *, const char *);
26 struct cache_tree_sub *cache_tree_sub(struct cache_tree *, const char *);
28 void cache_tree_write(struct strbuf *, struct cache_tree *root);
29 struct cache_tree *cache_tree_read(const char *buffer, unsigned long size);
31 int cache_tree_fully_valid(struct cache_tree *);
32 int cache_tree_update(struct cache_tree *, struct cache_entry **, int, int, int);
34 /* bitmasks to write_cache_as_tree flags */
35 #define WRITE_TREE_MISSING_OK 1
36 #define WRITE_TREE_IGNORE_CACHE_TREE 2
38 /* error return codes */
39 #define WRITE_TREE_UNREADABLE_INDEX (-1)
40 #define WRITE_TREE_UNMERGED_INDEX (-2)
41 #define WRITE_TREE_PREFIX_ERROR (-3)
43 int write_cache_as_tree(unsigned char *sha1, int flags, const char *prefix);
44 void prime_cache_tree(struct cache_tree **, struct tree *);
46 extern int cache_tree_matches_traversal(struct cache_tree *, struct name_entry *ent, struct traverse_info *info);