ci: run `hdr-check` as part of the `Static Analysis` job
[git/git.git] / midx.h
CommitLineData
0009d350
RJ
1#ifndef MIDX_H
2#define MIDX_H
a3407730 3
c4d25228
DS
4#include "repository.h"
5
642e5703
RJ
6struct object_id;
7struct pack_entry;
64404a24 8struct repository;
642e5703 9
0465a505
DS
10#define GIT_TEST_MULTI_PACK_INDEX "GIT_TEST_MULTI_PACK_INDEX"
11
4d80560c 12struct multi_pack_index {
c4d25228
DS
13 struct multi_pack_index *next;
14
4d80560c
DS
15 int fd;
16
17 const unsigned char *data;
18 size_t data_len;
19
20 uint32_t signature;
21 unsigned char version;
22 unsigned char hash_len;
23 unsigned char num_chunks;
24 uint32_t num_packs;
25 uint32_t num_objects;
26
2cf489a3
DS
27 int local;
28
32f3c541 29 const unsigned char *chunk_pack_names;
d7cacf29 30 const uint32_t *chunk_oid_fanout;
0d5b3a5e 31 const unsigned char *chunk_oid_lookup;
662148c4
DS
32 const unsigned char *chunk_object_offsets;
33 const unsigned char *chunk_large_offsets;
32f3c541 34
3227565c 35 const char **pack_names;
3715a633 36 struct packed_git **packs;
4d80560c
DS
37 char object_dir[FLEX_ARRAY];
38};
39
2cf489a3 40struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local);
64404a24 41int prepare_midx_pack(struct repository *r, struct multi_pack_index *m, uint32_t pack_int_id);
3715a633 42int bsearch_midx(const struct object_id *oid, struct multi_pack_index *m, uint32_t *result);
8aac67a1
DS
43struct object_id *nth_midxed_object_oid(struct object_id *oid,
44 struct multi_pack_index *m,
45 uint32_t n);
64404a24 46int fill_midx_entry(struct repository *r, const struct object_id *oid, struct pack_entry *e, struct multi_pack_index *m);
013fd7ad 47int midx_contains_pack(struct multi_pack_index *m, const char *idx_or_pack_name);
2cf489a3 48int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, int local);
4d80560c 49
a3407730 50int write_midx_file(const char *object_dir);
1dcd9f20 51void clear_midx_file(struct repository *r);
64404a24 52int verify_midx_file(struct repository *r, const char *object_dir);
cff97116 53int expire_midx_packs(struct repository *r, const char *object_dir);
2af890bb 54int midx_repack(struct repository *r, const char *object_dir, size_t batch_size);
a3407730 55
1dcd9f20 56void close_midx(struct multi_pack_index *m);
a3407730
DS
57
58#endif