Merge branch 'sg/test-verbose-log'
[git.git] / midx.h
blob1d6c21afe31b62024969f7cb91f9f78b19fe8e52
1 #ifndef MIDX_H
2 #define MIDX_H
4 #include "repository.h"
6 struct object_id;
7 struct pack_entry;
9 struct multi_pack_index {
10 struct multi_pack_index *next;
12 int fd;
14 const unsigned char *data;
15 size_t data_len;
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;
24 int local;
26 const unsigned char *chunk_pack_names;
27 const uint32_t *chunk_oid_fanout;
28 const unsigned char *chunk_oid_lookup;
29 const unsigned char *chunk_object_offsets;
30 const unsigned char *chunk_large_offsets;
32 const char **pack_names;
33 struct packed_git **packs;
34 char object_dir[FLEX_ARRAY];
37 struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local);
38 int prepare_midx_pack(struct multi_pack_index *m, uint32_t pack_int_id);
39 int bsearch_midx(const struct object_id *oid, struct multi_pack_index *m, uint32_t *result);
40 struct object_id *nth_midxed_object_oid(struct object_id *oid,
41 struct multi_pack_index *m,
42 uint32_t n);
43 int fill_midx_entry(const struct object_id *oid, struct pack_entry *e, struct multi_pack_index *m);
44 int midx_contains_pack(struct multi_pack_index *m, const char *idx_name);
45 int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, int local);
47 int write_midx_file(const char *object_dir);
48 void clear_midx_file(const char *object_dir);
49 int verify_midx_file(const char *object_dir);
51 #endif