🌐 AI搜索 & 代理 主页
blob: 119407e3a10562166fc61e009613842b213dfcfc [file] [log] [blame]
Junio C Hamano74986462006-04-23 23:52:201#ifndef CACHE_TREE_H
2#define CACHE_TREE_H
3
4struct cache_tree;
5struct cache_tree_sub {
6 struct cache_tree *cache_tree;
7 int namelen;
8 int used;
9 char name[FLEX_ARRAY];
10};
11
12struct 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
20struct cache_tree *cache_tree(void);
Junio C Hamanobad68ec2006-04-25 04:18:5821void cache_tree_free(struct cache_tree **);
Junio C Hamano74986462006-04-23 23:52:2022void cache_tree_invalidate_path(struct cache_tree *, const char *);
Junio C Hamano7927a552006-04-27 08:33:0723struct cache_tree_sub *cache_tree_sub(struct cache_tree *, const char *);
Junio C Hamano74986462006-04-23 23:52:2024
Junio C Hamanobad68ec2006-04-25 04:18:5825void *cache_tree_write(struct cache_tree *root, unsigned long *size_p);
26struct cache_tree *cache_tree_read(const char *buffer, unsigned long size);
Junio C Hamano74986462006-04-23 23:52:2027
Junio C Hamanobad68ec2006-04-25 04:18:5828int cache_tree_fully_valid(struct cache_tree *);
Junio C Hamano2956dd32006-04-27 23:21:5429int cache_tree_update(struct cache_tree *, struct cache_entry **, int, int, int);
Junio C Hamano74986462006-04-23 23:52:2030
Junio C Hamano6bd20352006-04-26 08:20:5031struct cache_tree *cache_tree_find(struct cache_tree *, const char *);
32
Junio C Hamano74986462006-04-23 23:52:2033#endif