Nguyễn Thái Ngọc Duy | 5fc2fc8 | 2014-06-13 19:19:36 +0700 | [diff] [blame] | 1 | #ifndef SPLIT_INDEX_H |
| 2 | #define SPLIT_INDEX_H |
| 3 | |
| 4 | struct index_state; |
| 5 | struct strbuf; |
Nguyễn Thái Ngọc Duy | 96a1d8d | 2014-06-13 19:19:40 +0700 | [diff] [blame] | 6 | struct ewah_bitmap; |
Nguyễn Thái Ngọc Duy | 5fc2fc8 | 2014-06-13 19:19:36 +0700 | [diff] [blame] | 7 | |
| 8 | struct split_index { |
| 9 | unsigned char base_sha1[20]; |
| 10 | struct index_state *base; |
Nguyễn Thái Ngọc Duy | 96a1d8d | 2014-06-13 19:19:40 +0700 | [diff] [blame] | 11 | struct ewah_bitmap *delete_bitmap; |
| 12 | struct ewah_bitmap *replace_bitmap; |
| 13 | struct cache_entry **saved_cache; |
Nguyễn Thái Ngọc Duy | 5fc2fc8 | 2014-06-13 19:19:36 +0700 | [diff] [blame] | 14 | unsigned int saved_cache_nr; |
Nguyễn Thái Ngọc Duy | 76b07b3 | 2014-06-13 19:19:41 +0700 | [diff] [blame] | 15 | unsigned int nr_deletions; |
| 16 | unsigned int nr_replacements; |
Nguyễn Thái Ngọc Duy | 5fc2fc8 | 2014-06-13 19:19:36 +0700 | [diff] [blame] | 17 | int refcount; |
| 18 | }; |
| 19 | |
| 20 | struct split_index *init_split_index(struct index_state *istate); |
Nguyễn Thái Ngọc Duy | 045113a | 2014-06-13 19:19:38 +0700 | [diff] [blame] | 21 | void save_or_free_index_entry(struct index_state *istate, struct cache_entry *ce); |
Nguyễn Thái Ngọc Duy | 078a58e | 2014-06-13 19:19:39 +0700 | [diff] [blame] | 22 | void replace_index_entry_in_base(struct index_state *istate, |
| 23 | struct cache_entry *old, |
| 24 | struct cache_entry *new); |
Nguyễn Thái Ngọc Duy | 5fc2fc8 | 2014-06-13 19:19:36 +0700 | [diff] [blame] | 25 | int read_link_extension(struct index_state *istate, |
| 26 | const void *data, unsigned long sz); |
| 27 | int write_link_extension(struct strbuf *sb, |
| 28 | struct index_state *istate); |
| 29 | void move_cache_to_base_index(struct index_state *istate); |
| 30 | void merge_base_index(struct index_state *istate); |
| 31 | void prepare_to_write_split_index(struct index_state *istate); |
| 32 | void finish_writing_split_index(struct index_state *istate); |
| 33 | void discard_split_index(struct index_state *istate); |
Christian Couder | cef4fc7 | 2017-02-27 19:00:01 +0100 | [diff] [blame] | 34 | void add_split_index(struct index_state *istate); |
| 35 | void remove_split_index(struct index_state *istate); |
Nguyễn Thái Ngọc Duy | 5fc2fc8 | 2014-06-13 19:19:36 +0700 | [diff] [blame] | 36 | |
| 37 | #endif |