diff options
Diffstat (limited to 'pack.h')
-rw-r--r-- | pack.h | 37 |
1 files changed, 24 insertions, 13 deletions
@@ -4,6 +4,8 @@ #include "object.h" #include "csum-file.h" +struct repository; + /* * Packed object header */ @@ -40,6 +42,8 @@ struct pack_idx_option { /* flag bits */ #define WRITE_IDX_VERIFY 01 /* verify only, do not write the idx file */ #define WRITE_IDX_STRICT 02 +#define WRITE_REV 04 +#define WRITE_REV_VERIFY 010 uint32_t version; uint32_t off32_limit; @@ -53,7 +57,7 @@ struct pack_idx_option { uint32_t *anomaly; }; -extern void reset_pack_idx_option(struct pack_idx_option *); +void reset_pack_idx_option(struct pack_idx_option *); /* * Packed object index header @@ -77,28 +81,35 @@ struct progress; /* Note, the data argument could be NULL if object type is blob */ typedef int (*verify_fn)(const struct object_id *, enum object_type, unsigned long, void*, int*); -extern const char *write_idx_file(const char *index_name, struct pack_idx_entry **objects, int nr_objects, const struct pack_idx_option *, const unsigned char *sha1); -extern int check_pack_crc(struct packed_git *p, struct pack_window **w_curs, off_t offset, off_t len, unsigned int nr); -extern int verify_pack_index(struct packed_git *); -extern int verify_pack(struct packed_git *, verify_fn fn, struct progress *, uint32_t); -extern off_t write_pack_header(struct hashfile *f, uint32_t); -extern void fixup_pack_header_footer(int, unsigned char *, const char *, uint32_t, unsigned char *, off_t); -extern char *index_pack_lockfile(int fd); +const char *write_idx_file(const char *index_name, struct pack_idx_entry **objects, int nr_objects, const struct pack_idx_option *, const unsigned char *sha1); +int check_pack_crc(struct packed_git *p, struct pack_window **w_curs, off_t offset, off_t len, unsigned int nr); +int verify_pack_index(struct packed_git *); +int verify_pack(struct repository *, struct packed_git *, verify_fn fn, struct progress *, uint32_t); +off_t write_pack_header(struct hashfile *f, uint32_t); +void fixup_pack_header_footer(int, unsigned char *, const char *, uint32_t, unsigned char *, off_t); +char *index_pack_lockfile(int fd, int *is_well_formed); + +struct ref; + +void write_promisor_file(const char *promisor_name, struct ref **sought, int nr_sought); + +const char *write_rev_file(const char *rev_name, struct pack_idx_entry **objects, uint32_t nr_objects, const unsigned char *hash, unsigned flags); +const char *write_rev_file_order(const char *rev_name, uint32_t *pack_order, uint32_t nr_objects, const unsigned char *hash, unsigned flags); /* * The "hdr" output buffer should be at least this big, which will handle sizes * up to 2^67. */ #define MAX_PACK_OBJECT_HEADER 10 -extern int encode_in_pack_object_header(unsigned char *hdr, int hdr_len, - enum object_type, uintmax_t); +int encode_in_pack_object_header(unsigned char *hdr, int hdr_len, + enum object_type, uintmax_t); #define PH_ERROR_EOF (-1) #define PH_ERROR_PACK_SIGNATURE (-2) #define PH_ERROR_PROTOCOL (-3) -extern int read_pack_header(int fd, struct pack_header *); +int read_pack_header(int fd, struct pack_header *); -extern struct hashfile *create_tmp_packfile(char **pack_tmp_name); -extern void finish_tmp_packfile(struct strbuf *name_buffer, const char *pack_tmp_name, struct pack_idx_entry **written_list, uint32_t nr_written, struct pack_idx_option *pack_idx_opts, unsigned char sha1[]); +struct hashfile *create_tmp_packfile(char **pack_tmp_name); +void finish_tmp_packfile(struct strbuf *name_buffer, const char *pack_tmp_name, struct pack_idx_entry **written_list, uint32_t nr_written, struct pack_idx_option *pack_idx_opts, unsigned char sha1[]); #endif |