2018-07-13 03:39:21 +08:00
|
|
|
#ifndef __MIDX_H__
|
|
|
|
#define __MIDX_H__
|
|
|
|
|
2018-07-13 03:39:23 +08:00
|
|
|
struct multi_pack_index {
|
|
|
|
int fd;
|
|
|
|
|
|
|
|
const unsigned char *data;
|
|
|
|
size_t data_len;
|
|
|
|
|
|
|
|
uint32_t signature;
|
|
|
|
unsigned char version;
|
|
|
|
unsigned char hash_len;
|
|
|
|
unsigned char num_chunks;
|
|
|
|
uint32_t num_packs;
|
|
|
|
uint32_t num_objects;
|
|
|
|
|
2018-07-13 03:39:27 +08:00
|
|
|
const unsigned char *chunk_pack_names;
|
|
|
|
|
2018-07-13 03:39:28 +08:00
|
|
|
const char **pack_names;
|
2018-07-13 03:39:23 +08:00
|
|
|
char object_dir[FLEX_ARRAY];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct multi_pack_index *load_multi_pack_index(const char *object_dir);
|
|
|
|
|
2018-07-13 03:39:21 +08:00
|
|
|
int write_midx_file(const char *object_dir);
|
|
|
|
|
|
|
|
#endif
|