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