split-index.h 1.23 KB
Newer Older
1 2 3
#ifndef SPLIT_INDEX_H
#define SPLIT_INDEX_H

4 5
#include "cache.h"

6 7
struct index_state;
struct strbuf;
8
struct ewah_bitmap;
9 10

struct split_index {
11
	struct object_id base_oid;
12
	struct index_state *base;
13 14 15
	struct ewah_bitmap *delete_bitmap;
	struct ewah_bitmap *replace_bitmap;
	struct cache_entry **saved_cache;
16
	unsigned int saved_cache_nr;
17 18
	unsigned int nr_deletions;
	unsigned int nr_replacements;
19 20 21 22
	int refcount;
};

struct split_index *init_split_index(struct index_state *istate);
23
void save_or_free_index_entry(struct index_state *istate, struct cache_entry *ce);
24 25
void replace_index_entry_in_base(struct index_state *istate,
				 struct cache_entry *old,
26
				 struct cache_entry *new_entry);
27 28 29 30 31 32 33 34 35
int read_link_extension(struct index_state *istate,
			const void *data, unsigned long sz);
int write_link_extension(struct strbuf *sb,
			 struct index_state *istate);
void move_cache_to_base_index(struct index_state *istate);
void merge_base_index(struct index_state *istate);
void prepare_to_write_split_index(struct index_state *istate);
void finish_writing_split_index(struct index_state *istate);
void discard_split_index(struct index_state *istate);
36 37
void add_split_index(struct index_state *istate);
void remove_split_index(struct index_state *istate);
38 39

#endif