midx: use chunk-format API in write_midx_internal()
[git/debian.git] / chunk-format.h
blobce598b66d9f8da351037d391c509975e22f4689e
1 #ifndef CHUNK_FORMAT_H
2 #define CHUNK_FORMAT_H
4 #include "git-compat-util.h"
6 struct hashfile;
7 struct chunkfile;
9 #define CHUNK_TOC_ENTRY_SIZE (sizeof(uint32_t) + sizeof(uint64_t))
11 struct chunkfile *init_chunkfile(struct hashfile *f);
12 void free_chunkfile(struct chunkfile *cf);
13 int get_num_chunks(struct chunkfile *cf);
14 typedef int (*chunk_write_fn)(struct hashfile *f, void *data);
15 void add_chunk(struct chunkfile *cf,
16 uint32_t id,
17 size_t size,
18 chunk_write_fn fn);
19 int write_chunkfile(struct chunkfile *cf, void *data);
21 #endif