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 | |
brian m. carlson | 2182abd | 2018-05-02 00:25:43 +0000 | [diff] [blame] | 4 | #include "cache.h" |
| 5 | |
Nguyễn Thái Ngọc Duy | 5fc2fc8 | 2014-06-13 19:19:36 +0700 | [diff] [blame] | 6 | struct index_state; |
| 7 | struct strbuf; |
Nguyễn Thái Ngọc Duy | 96a1d8d | 2014-06-13 19:19:40 +0700 | [diff] [blame] | 8 | struct ewah_bitmap; |
Nguyễn Thái Ngọc Duy | 5fc2fc8 | 2014-06-13 19:19:36 +0700 | [diff] [blame] | 9 | |
| 10 | struct split_index { |
brian m. carlson | 2182abd | 2018-05-02 00:25:43 +0000 | [diff] [blame] | 11 | struct object_id base_oid; |
Nguyễn Thái Ngọc Duy | 5fc2fc8 | 2014-06-13 19:19:36 +0700 | [diff] [blame] | 12 | struct index_state *base; |
Nguyễn Thái Ngọc Duy | 96a1d8d | 2014-06-13 19:19:40 +0700 | [diff] [blame] | 13 | struct ewah_bitmap *delete_bitmap; |
| 14 | struct ewah_bitmap *replace_bitmap; |
| 15 | struct cache_entry **saved_cache; |
Nguyễn Thái Ngọc Duy | 5fc2fc8 | 2014-06-13 19:19:36 +0700 | [diff] [blame] | 16 | unsigned int saved_cache_nr; |
Nguyễn Thái Ngọc Duy | 76b07b3 | 2014-06-13 19:19:41 +0700 | [diff] [blame] | 17 | unsigned int nr_deletions; |
| 18 | unsigned int nr_replacements; |
Nguyễn Thái Ngọc Duy | 5fc2fc8 | 2014-06-13 19:19:36 +0700 | [diff] [blame] | 19 | int refcount; |
| 20 | }; |
| 21 | |
| 22 | 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] | 23 | 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] | 24 | void replace_index_entry_in_base(struct index_state *istate, |
| 25 | struct cache_entry *old, |
Brandon Williams | 75b7b97 | 2018-02-14 10:59:48 -0800 | [diff] [blame] | 26 | struct cache_entry *new_entry); |
Nguyễn Thái Ngọc Duy | 5fc2fc8 | 2014-06-13 19:19:36 +0700 | [diff] [blame] | 27 | int read_link_extension(struct index_state *istate, |
| 28 | const void *data, unsigned long sz); |
| 29 | int write_link_extension(struct strbuf *sb, |
| 30 | struct index_state *istate); |
| 31 | void move_cache_to_base_index(struct index_state *istate); |
| 32 | void merge_base_index(struct index_state *istate); |
| 33 | void prepare_to_write_split_index(struct index_state *istate); |
| 34 | void finish_writing_split_index(struct index_state *istate); |
| 35 | void discard_split_index(struct index_state *istate); |
Christian Couder | cef4fc7 | 2017-02-27 19:00:01 +0100 | [diff] [blame] | 36 | void add_split_index(struct index_state *istate); |
| 37 | 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] | 38 | |
| 39 | #endif |