7 struct cache_tree_sub
{
8 struct cache_tree
*cache_tree
;
11 char name
[FLEX_ARRAY
];
15 int entry_count
; /* negative means "invalid" */
16 unsigned char sha1
[20];
19 struct cache_tree_sub
**down
;
22 struct cache_tree
*cache_tree(void);
23 void cache_tree_free(struct cache_tree
**);
24 void cache_tree_invalidate_path(struct cache_tree
*, const char *);
25 struct cache_tree_sub
*cache_tree_sub(struct cache_tree
*, const char *);
27 void cache_tree_write(struct strbuf
*, struct cache_tree
*root
);
28 struct cache_tree
*cache_tree_read(const char *buffer
, unsigned long size
);
30 int cache_tree_fully_valid(struct cache_tree
*);
31 int cache_tree_update(struct cache_tree
*, struct cache_entry
**, int, int, int);
33 #define WRITE_TREE_UNREADABLE_INDEX (-1)
34 #define WRITE_TREE_UNMERGED_INDEX (-2)
35 #define WRITE_TREE_PREFIX_ERROR (-3)
37 int write_cache_as_tree(unsigned char *sha1
, int missing_ok
, const char *prefix
);
38 void prime_cache_tree(struct cache_tree
**, struct tree
*);