summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7ef2d9a)
raw | patch | inline | side by side (parent: 7ef2d9a)
author | Junio C Hamano <gitster@pobox.com> | |
Sun, 15 May 2011 02:42:10 +0000 (19:42 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 21 May 2011 06:16:53 +0000 (23:16 -0700) |
Make map_sha1_file(), parse_sha1_header() and unpack_sha1_header()
available to the streaming read API by exporting them via cache.h header
file.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
available to the streaming read API by exporting them via cache.h header
file.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h | patch | blob | history | |
sha1_file.c | patch | blob | history |
index 2a7a77f3ebd72c25eaf1d00c94f269ccb24dde55..a5067ba12d6f116764700fe7d207e74a6b4df560 100644 (file)
--- a/cache.h
+++ b/cache.h
extern int write_sha1_file(const void *buf, unsigned long len, const char *type, unsigned char *return_sha1);
extern int pretend_sha1_file(void *, unsigned long, enum object_type, unsigned char *);
extern int force_object_loose(const unsigned char *sha1, time_t mtime);
+extern void *map_sha1_file(const unsigned char *sha1, unsigned long *size);
+extern int unpack_sha1_header(z_stream *stream, unsigned char *map, unsigned long mapsize, void *buffer, unsigned long bufsiz);
+extern int parse_sha1_header(const char *hdr, unsigned long *sizep);
/* global flag to enable extra checks when accessing packed objects */
extern int do_check_packed_object_crc;
diff --git a/sha1_file.c b/sha1_file.c
index a28683aaf0b3be2308caf89674a59d4d6ad9ac31..5fc877fe4c579f97e3f5f6e6cebf5742e8a46a32 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
return -1;
}
-static void *map_sha1_file(const unsigned char *sha1, unsigned long *size)
+void *map_sha1_file(const unsigned char *sha1, unsigned long *size)
{
void *map;
int fd;
return used;
}
-static int unpack_sha1_header(z_stream *stream, unsigned char *map, unsigned long mapsize, void *buffer, unsigned long bufsiz)
+int unpack_sha1_header(z_stream *stream, unsigned char *map, unsigned long mapsize, void *buffer, unsigned long bufsiz)
{
unsigned long size, used;
static const char valid_loose_object_type[8] = {
@@ -1342,7 +1342,7 @@ static void *unpack_sha1_rest(z_stream *stream, void *buffer, unsigned long size
* too permissive for what we want to check. So do an anal
* object header parse by hand.
*/
-static int parse_sha1_header(const char *hdr, unsigned long *sizep)
+int parse_sha1_header(const char *hdr, unsigned long *sizep)
{
char type[10];
int i;