path: root/cache.h
diff options
authorLinus Torvalds <>2005-06-02 00:54:59 (GMT)
committerLinus Torvalds <>2005-06-02 00:54:59 (GMT)
commitc4483576b8d30fadcae208d8f12383febd060d0a (patch)
treea062ffc614a516f3ee2090f9336e86d0ed8091e6 /cache.h
parentf35ca9ed3ef02541a938f3bd43cad83af93eb94f (diff)
Add "unpack_sha1_header()" helper function
It's for people who aren't necessarily interested in the whole unpacked file, but do want to know the header information (size, type, etc..) For example, the delta code can use this to figure out whether an object is already a delta object, and what it is a delta against, without actually bothering to unpack all of the actual data in the delta.
Diffstat (limited to 'cache.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index d38d9a8..69b63ba 100644
--- a/cache.h
+++ b/cache.h
@@ -151,6 +151,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 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);