X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=csum-file.h;h=3ad1a992a758fc9339baa2cecc17ac14af359f1b;hb=b642d9ef643371990c0a921836f2a074d48ce1b3;hp=1086f04caa228f044cdce0b5f0f63edfbc3bed79;hpb=c38138cd78f284b261a02323e8f18a1dee87c7fa;p=git.git diff --git a/csum-file.h b/csum-file.h index 1086f04c..3ad1a992 100644 --- a/csum-file.h +++ b/csum-file.h @@ -4,13 +4,15 @@ /* A SHA1-protected file */ struct sha1file { int fd, error; - unsigned long offset; + unsigned int offset, namelen; SHA_CTX ctx; + char name[PATH_MAX]; unsigned char buffer[8192]; }; -extern struct sha1file *sha1create(const char *fmt, ...); -extern int sha1close(struct sha1file *); +extern struct sha1file *sha1fd(int fd, const char *name); +extern struct sha1file *sha1create(const char *fmt, ...) __attribute__((format (printf, 1, 2))); +extern int sha1close(struct sha1file *, unsigned char *, int); extern int sha1write(struct sha1file *, void *, unsigned int); extern int sha1write_compressed(struct sha1file *, void *, unsigned int);