aboutsummaryrefslogtreecommitdiffstats
path: root/reftable/basics.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-11-19 12:24:33 +0900
committerJunio C Hamano <gitster@pobox.com>2024-11-19 12:24:33 +0900
commitb8558e6abd8715cc9557abf10e8768e475fdeb5e (patch)
tree7855252e56792e6acce38a79e4897eb6deee925e /reftable/basics.h
parent8f8d6eee531b3fa1a8ef14f169b0cb5035f7a772 (diff)
parent988e7f5e952bbb7b6ae885f4da744f536f22693f (diff)
downloadgit-b8558e6abd8715cc9557abf10e8768e475fdeb5e.tar.gz
Merge branch 'ps/reftable-detach' into ps/reftable-iterator-reuse
* ps/reftable-detach: reftable/system: provide thin wrapper for lockfile subsystem reftable/stack: drop only use of `get_locked_file_path()` reftable/system: provide thin wrapper for tempfile subsystem reftable/stack: stop using `fsync_component()` directly reftable/system: stop depending on "hash.h" reftable: explicitly handle hash format IDs reftable/system: move "dir.h" to its only user
Diffstat (limited to 'reftable/basics.h')
-rw-r--r--reftable/basics.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/reftable/basics.h b/reftable/basics.h
index 7aa46d7c30..36beda2c25 100644
--- a/reftable/basics.h
+++ b/reftable/basics.h
@@ -148,6 +148,14 @@ char *reftable_strdup(const char *str);
/* Find the longest shared prefix size of `a` and `b` */
int common_prefix_size(struct reftable_buf *a, struct reftable_buf *b);
-int hash_size(uint32_t id);
+int hash_size(enum reftable_hash id);
+
+/*
+ * Format IDs that identify the hash function used by a reftable. Note that
+ * these constants end up on disk and thus mustn't change. The format IDs are
+ * "sha1" and "s256" in big endian, respectively.
+ */
+#define REFTABLE_FORMAT_ID_SHA1 ((uint32_t) 0x73686131)
+#define REFTABLE_FORMAT_ID_SHA256 ((uint32_t) 0x73323536)
#endif