From 5180cacc202bb20b15981469487eb8d6b0509997 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 2 Jun 2005 07:57:25 -0700 Subject: Split up unpack_sha1_file() some more Make a separate helper for parsing the header of an object file (really carefully) and for unpacking the rest. This means that anybody who uses the "unpack_sha1_header()" interface can easily look at the header and decide to unpack the rest too, without doing any extra work. --- cache.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cache.h') diff --git a/cache.h b/cache.h index 69b63ba1d..aa74bcc01 100644 --- a/cache.h +++ b/cache.h @@ -152,6 +152,7 @@ extern char *sha1_file_name(const unsigned char *sha1); /* Read and unpack a sha1 file into memory, write memory to a sha1 file */ extern void * map_sha1_file(const unsigned char *sha1, unsigned long *size); extern int unpack_sha1_header(z_stream *stream, void *map, unsigned long mapsize, void *buffer, unsigned long size); +extern int parse_sha1_header(char *hdr, char *type, unsigned long *sizep); extern void * unpack_sha1_file(void *map, unsigned long mapsize, char *type, unsigned long *size); extern void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size); extern int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned char *return_sha1); -- cgit v1.2.1