Fourth batch for 2.20
[git/git.git] / midx.h
CommitLineData
a3407730
DS
1#ifndef __MIDX_H__
2#define __MIDX_H__
3
c4d25228
DS
4#include "repository.h"
5
642e5703
RJ
6struct object_id;
7struct pack_entry;
8
4d80560c 9struct multi_pack_index {
c4d25228
DS
10 struct multi_pack_index *next;
11
4d80560c
DS
12 int fd;
13
14 const unsigned char *data;
15 size_t data_len;
16
17 uint32_t signature;
18 unsigned char version;
19 unsigned char hash_len;
20 unsigned char num_chunks;
21 uint32_t num_packs;
22 uint32_t num_objects;
23
2cf489a3
DS
24 int local;
25
32f3c541 26 const unsigned char *chunk_pack_names;
d7cacf29 27 const uint32_t *chunk_oid_fanout;
0d5b3a5e 28 const unsigned char *chunk_oid_lookup;
662148c4
DS
29 const unsigned char *chunk_object_offsets;
30 const unsigned char *chunk_large_offsets;
32f3c541 31
3227565c 32 const char **pack_names;
3715a633 33 struct packed_git **packs;
4d80560c
DS
34 char object_dir[FLEX_ARRAY];
35};
36
2cf489a3 37struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local);
0bff5269 38int prepare_midx_pack(struct multi_pack_index *m, uint32_t pack_int_id);
3715a633 39int bsearch_midx(const struct object_id *oid, struct multi_pack_index *m, uint32_t *result);
8aac67a1
DS
40struct object_id *nth_midxed_object_oid(struct object_id *oid,
41 struct multi_pack_index *m,
42 uint32_t n);
3715a633 43int fill_midx_entry(const struct object_id *oid, struct pack_entry *e, struct multi_pack_index *m);
a40498a1 44int midx_contains_pack(struct multi_pack_index *m, const char *idx_name);
2cf489a3 45int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, int local);
4d80560c 46
a3407730 47int write_midx_file(const char *object_dir);
525e18c0 48void clear_midx_file(const char *object_dir);
56ee7ff1 49int verify_midx_file(const char *object_dir);
a3407730
DS
50
51#endif