refs/ref-cache.h: add missing declarations (hdr-check)
[gitweb.git] / midx.h
diff --git a/midx.h b/midx.h
index 8572cf0f4b3540871482993d3affd1a9def48c88..a210f1af2af6bd7c7dc2210ac4b5ca398c8c60d1 100644 (file)
--- a/midx.h
+++ b/midx.h
@@ -1,7 +1,11 @@
 #ifndef __MIDX_H__
 #define __MIDX_H__
 
+#include "repository.h"
+
 struct multi_pack_index {
+       struct multi_pack_index *next;
+
        int fd;
 
        const unsigned char *data;
@@ -14,16 +18,30 @@ struct multi_pack_index {
        uint32_t num_packs;
        uint32_t num_objects;
 
+       int local;
+
        const unsigned char *chunk_pack_names;
        const uint32_t *chunk_oid_fanout;
        const unsigned char *chunk_oid_lookup;
+       const unsigned char *chunk_object_offsets;
+       const unsigned char *chunk_large_offsets;
 
        const char **pack_names;
+       struct packed_git **packs;
        char object_dir[FLEX_ARRAY];
 };
 
-struct multi_pack_index *load_multi_pack_index(const char *object_dir);
+struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local);
+int prepare_midx_pack(struct multi_pack_index *m, uint32_t pack_int_id);
+int bsearch_midx(const struct object_id *oid, struct multi_pack_index *m, uint32_t *result);
+struct object_id *nth_midxed_object_oid(struct object_id *oid,
+                                       struct multi_pack_index *m,
+                                       uint32_t n);
+int fill_midx_entry(const struct object_id *oid, struct pack_entry *e, struct multi_pack_index *m);
+int midx_contains_pack(struct multi_pack_index *m, const char *idx_name);
+int prepare_multi_pack_index_one(struct repository *r, const char *object_dir, int local);
 
 int write_midx_file(const char *object_dir);
+void clear_midx_file(const char *object_dir);
 
 #endif