| /* A SHA1-protected file */ |
| unsigned char buffer[8192]; |
| struct hashfile_checkpoint { |
| extern void hashfile_checkpoint(struct hashfile *, struct hashfile_checkpoint *); |
| extern int hashfile_truncate(struct hashfile *, struct hashfile_checkpoint *); |
| extern struct hashfile *hashfd(int fd, const char *name); |
| extern struct hashfile *hashfd_check(const char *name); |
| extern struct hashfile *hashfd_throughput(int fd, const char *name, struct progress *tp); |
| extern int hashclose(struct hashfile *, unsigned char *, unsigned int); |
| extern void hashwrite(struct hashfile *, const void *, unsigned int); |
| extern void hashflush(struct hashfile *f); |
| extern void crc32_begin(struct hashfile *); |
| extern uint32_t crc32_end(struct hashfile *); |
| static inline void hashwrite_u8(struct hashfile *f, uint8_t data) |
| hashwrite(f, &data, sizeof(data)); |
| static inline void hashwrite_be32(struct hashfile *f, uint32_t data) |
| hashwrite(f, &data, sizeof(data)); |