2006-04-24 03:52:20 +04:00
|
|
|
#ifndef CACHE_TREE_H
|
|
|
|
#define CACHE_TREE_H
|
|
|
|
|
|
|
|
struct cache_tree;
|
|
|
|
struct cache_tree_sub {
|
|
|
|
struct cache_tree *cache_tree;
|
|
|
|
int namelen;
|
|
|
|
int used;
|
|
|
|
char name[FLEX_ARRAY];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct cache_tree {
|
|
|
|
int entry_count; /* negative means "invalid" */
|
|
|
|
unsigned char sha1[20];
|
|
|
|
int subtree_nr;
|
|
|
|
int subtree_alloc;
|
|
|
|
struct cache_tree_sub **down;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct cache_tree *cache_tree(void);
|
2006-04-25 08:18:58 +04:00
|
|
|
void cache_tree_free(struct cache_tree **);
|
2006-04-24 03:52:20 +04:00
|
|
|
void cache_tree_invalidate_path(struct cache_tree *, const char *);
|
2006-04-27 12:33:07 +04:00
|
|
|
struct cache_tree_sub *cache_tree_sub(struct cache_tree *, const char *);
|
2006-04-24 03:52:20 +04:00
|
|
|
|
2006-04-25 08:18:58 +04:00
|
|
|
void *cache_tree_write(struct cache_tree *root, unsigned long *size_p);
|
|
|
|
struct cache_tree *cache_tree_read(const char *buffer, unsigned long size);
|
2006-04-24 03:52:20 +04:00
|
|
|
|
2006-04-25 08:18:58 +04:00
|
|
|
int cache_tree_fully_valid(struct cache_tree *);
|
2006-04-28 03:21:54 +04:00
|
|
|
int cache_tree_update(struct cache_tree *, struct cache_entry **, int, int, int);
|
2006-04-24 03:52:20 +04:00
|
|
|
|
2006-04-26 12:20:50 +04:00
|
|
|
struct cache_tree *cache_tree_find(struct cache_tree *, const char *);
|
|
|
|
|
2006-04-24 03:52:20 +04:00
|
|
|
#endif
|