blob: 3ad1a992a758fc9339baa2cecc17ac14af359f1b [file] [log] [blame]
Linus Torvaldsc38138c2005-06-27 03:27:561#ifndef CSUM_FILE_H
2#define CSUM_FILE_H
3
4/* A SHA1-protected file */
5struct sha1file {
6 int fd, error;
Linus Torvaldse1808842005-06-27 05:01:467 unsigned int offset, namelen;
Linus Torvaldsc38138c2005-06-27 03:27:568 SHA_CTX ctx;
Linus Torvaldse1808842005-06-27 05:01:469 char name[PATH_MAX];
Linus Torvaldsc38138c2005-06-27 03:27:5610 unsigned char buffer[8192];
11};
12
Linus Torvalds4397f012005-06-28 18:10:0613extern struct sha1file *sha1fd(int fd, const char *name);
Timo Sirainen4ec99bf2005-08-09 15:30:2214extern struct sha1file *sha1create(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
Linus Torvaldse1808842005-06-27 05:01:4615extern int sha1close(struct sha1file *, unsigned char *, int);
Linus Torvaldsc38138c2005-06-27 03:27:5616extern int sha1write(struct sha1file *, void *, unsigned int);
17extern int sha1write_compressed(struct sha1file *, void *, unsigned int);
18
19#endif