2005-06-27 07:27:56 +04:00
|
|
|
#ifndef CSUM_FILE_H
|
|
|
|
#define CSUM_FILE_H
|
|
|
|
|
|
|
|
/* A SHA1-protected file */
|
|
|
|
struct sha1file {
|
|
|
|
int fd, error;
|
2005-06-27 09:01:46 +04:00
|
|
|
unsigned int offset, namelen;
|
2005-06-27 07:27:56 +04:00
|
|
|
SHA_CTX ctx;
|
2005-06-27 09:01:46 +04:00
|
|
|
char name[PATH_MAX];
|
2005-06-27 07:27:56 +04:00
|
|
|
unsigned char buffer[8192];
|
|
|
|
};
|
|
|
|
|
2005-06-28 22:10:06 +04:00
|
|
|
extern struct sha1file *sha1fd(int fd, const char *name);
|
2005-08-09 19:30:22 +04:00
|
|
|
extern struct sha1file *sha1create(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
|
2005-06-27 09:01:46 +04:00
|
|
|
extern int sha1close(struct sha1file *, unsigned char *, int);
|
2005-06-27 07:27:56 +04:00
|
|
|
extern int sha1write(struct sha1file *, void *, unsigned int);
|
|
|
|
extern int sha1write_compressed(struct sha1file *, void *, unsigned int);
|
|
|
|
|
|
|
|
#endif
|