builtin/mktree: remove hard-coded constant
[git/debian.git] / midx.h
bloba210f1af2af6bd7c7dc2210ac4b5ca398c8c60d1
1 #ifndef __MIDX_H__
2 #define __MIDX_H__
4 #include "repository.h"
6 struct multi_pack_index {
7 struct multi_pack_index *next;
9 int fd;
11 const unsigned char *data;
12 size_t data_len;
14 uint32_t signature;
15 unsigned char version;
16 unsigned char hash_len;
17 unsigned char num_chunks;
18 uint32_t num_packs;
19 uint32_t num_objects;
21 int local;
23 const unsigned char *chunk_pack_names;
24 const uint32_t *chunk_oid_fanout;
25 const unsigned char *chunk_oid_lookup;
26 const unsigned char *chunk_object_offsets;
27 const unsigned char *chunk_large_offsets;
29 const char **pack_names;
30 struct packed_git **packs;
31 char object_dir[FLEX_ARRAY];
34 struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local);
35 int prepare_midx_pack(struct multi_pack_index *m, uint32_t pack_int_id);
36 int bsearch_midx(const struct object_id *oid, struct multi_pack_index *m, uint32_t *result);
37 struct object_id *nth_midxed_object_oid(struct object_id *oid,
38 struct multi_pack_index *m,
39 uint32_t n);
40 int fill_midx_entry(const struct object_id *oid, struct pack_entry *e, struct multi_pack_index *m);
41 int midx_contains_pack(struct multi_pack_index *m, const char *idx_name);
42 int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, int local);
44 int write_midx_file(const char *object_dir);
45 void clear_midx_file(const char *object_dir);
47 #endif