6 /* A SHA1-protected file */
17 unsigned char buffer
[8192];
21 struct hashfile_checkpoint
{
26 extern void hashfile_checkpoint(struct hashfile
*, struct hashfile_checkpoint
*);
27 extern int hashfile_truncate(struct hashfile
*, struct hashfile_checkpoint
*);
33 extern struct hashfile
*hashfd(int fd
, const char *name
);
34 extern struct hashfile
*hashfd_check(const char *name
);
35 extern struct hashfile
*hashfd_throughput(int fd
, const char *name
, struct progress
*tp
);
36 extern int hashclose(struct hashfile
*, unsigned char *, unsigned int);
37 extern void hashwrite(struct hashfile
*, const void *, unsigned int);
38 extern void hashflush(struct hashfile
*f
);
39 extern void crc32_begin(struct hashfile
*);
40 extern uint32_t crc32_end(struct hashfile
*);
42 static inline void hashwrite_u8(struct hashfile
*f
, uint8_t data
)
44 hashwrite(f
, &data
, sizeof(data
));
47 static inline void hashwrite_be32(struct hashfile
*f
, uint32_t data
)
50 hashwrite(f
, &data
, sizeof(data
));