]> git.ipfire.org Git - thirdparty/git.git/blobdiff - csum-file.h
t4216: avoid unnecessary subshell in test_bloom_filters_not_used
[thirdparty/git.git] / csum-file.h
index a98b1eee53f40367ad06c7aa82da7af0ca6ed6bc..f9cbd317fbbce89547a405783fb5cc69e7815efa 100644 (file)
@@ -42,6 +42,15 @@ void hashflush(struct hashfile *f);
 void crc32_begin(struct hashfile *);
 uint32_t crc32_end(struct hashfile *);
 
+/*
+ * Returns the total number of bytes fed to the hashfile so far (including ones
+ * that have not been written out to the descriptor yet).
+ */
+static inline off_t hashfile_total(struct hashfile *f)
+{
+       return f->total + f->offset;
+}
+
 static inline void hashwrite_u8(struct hashfile *f, uint8_t data)
 {
        hashwrite(f, &data, sizeof(data));