diff options
author | Derrick Stolee <stolee@gmail.com> | 2018-07-12 15:39:23 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-20 11:27:28 -0700 |
commit | 4d80560c546179654c32499132a6bdaf3c45b16f (patch) | |
tree | 8d6d74755e0d85b4924926b0f37c3367b90dd0b9 /midx.h | |
parent | fc59e74844613feac74f305943656f21f92c705e (diff) | |
download | git-4d80560c546179654c32499132a6bdaf3c45b16f.tar.gz |
multi-pack-index: load into memory
Create a new multi_pack_index struct for loading multi-pack-indexes into
memory. Create a test-tool builtin for reading basic information about
that multi-pack-index to verify the correct data is written.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'midx.h')
-rw-r--r-- | midx.h | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1,6 +1,24 @@ #ifndef __MIDX_H__ #define __MIDX_H__ +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; + + char object_dir[FLEX_ARRAY]; +}; + +struct multi_pack_index *load_multi_pack_index(const char *object_dir); + int write_midx_file(const char *object_dir); #endif |