pack-objects: split add_object_entry
[git.git] / pack-bitmap.h
blobb4510d5ccdc4638b300a1d58f3f2c7b340cc5551
1 #ifndef PACK_BITMAP_H
2 #define PACK_BITMAP_H
4 #include "ewah/ewok.h"
5 #include "khash.h"
7 struct bitmap_disk_entry {
8 uint32_t object_pos;
9 uint8_t xor_offset;
10 uint8_t flags;
11 } __attribute__((packed));
13 struct bitmap_disk_header {
14 char magic[4];
15 uint16_t version;
16 uint16_t options;
17 uint32_t entry_count;
18 unsigned char checksum[20];
21 static const char BITMAP_IDX_SIGNATURE[] = {'B', 'I', 'T', 'M'};
23 enum pack_bitmap_opts {
24 BITMAP_OPT_FULL_DAG = 1
27 typedef int (*show_reachable_fn)(
28 const unsigned char *sha1,
29 enum object_type type,
30 int flags,
31 uint32_t hash,
32 struct packed_git *found_pack,
33 off_t found_offset);
35 int prepare_bitmap_git(void);
36 void count_bitmap_commit_list(uint32_t *commits, uint32_t *trees, uint32_t *blobs, uint32_t *tags);
37 void traverse_bitmap_commit_list(show_reachable_fn show_reachable);
38 void test_bitmap_walk(struct rev_info *revs);
39 char *pack_bitmap_filename(struct packed_git *p);
40 int prepare_bitmap_walk(struct rev_info *revs);
41 int reuse_partial_packfile_from_bitmap(struct packed_git **packfile, uint32_t *entries, off_t *up_to);
43 #endif