Linus Torvalds | c38138c | 2005-06-26 20:27:56 -0700 | [diff] [blame] | 1 | #ifndef CSUM_FILE_H |
| 2 | #define CSUM_FILE_H |
| 3 | |
| 4 | /* A SHA1-protected file */ |
| 5 | struct sha1file { |
| 6 | int fd, error; |
Linus Torvalds | e180884 | 2005-06-26 22:01:46 -0700 | [diff] [blame] | 7 | unsigned int offset, namelen; |
Linus Torvalds | c38138c | 2005-06-26 20:27:56 -0700 | [diff] [blame] | 8 | SHA_CTX ctx; |
Linus Torvalds | e180884 | 2005-06-26 22:01:46 -0700 | [diff] [blame] | 9 | char name[PATH_MAX]; |
Linus Torvalds | c38138c | 2005-06-26 20:27:56 -0700 | [diff] [blame] | 10 | unsigned char buffer[8192]; |
| 11 | }; |
| 12 | |
Linus Torvalds | 4397f01 | 2005-06-28 11:10:06 -0700 | [diff] [blame] | 13 | extern struct sha1file *sha1fd(int fd, const char *name); |
Timo Sirainen | 4ec99bf | 2005-08-09 18:30:22 +0300 | [diff] [blame] | 14 | extern struct sha1file *sha1create(const char *fmt, ...) __attribute__((format (printf, 1, 2))); |
Linus Torvalds | e180884 | 2005-06-26 22:01:46 -0700 | [diff] [blame] | 15 | extern int sha1close(struct sha1file *, unsigned char *, int); |
Linus Torvalds | c38138c | 2005-06-26 20:27:56 -0700 | [diff] [blame] | 16 | extern int sha1write(struct sha1file *, void *, unsigned int); |
| 17 | extern int sha1write_compressed(struct sha1file *, void *, unsigned int); |
| 18 | |
| 19 | #endif |