aboutsummaryrefslogtreecommitdiffstats
path: root/reftable/reftable-basics.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-12-10 10:04:56 +0900
committerJunio C Hamano <gitster@pobox.com>2024-12-10 10:04:56 +0900
commitde9278127e107455fda269d2db280782d77e5eba (patch)
treed6b91c410d041a5b24e8a3c25f9fdba59c629a97 /reftable/reftable-basics.h
parent35f40385e441d5aa885f5aa813539d5ed9dc2d26 (diff)
parent988e7f5e952bbb7b6ae885f4da744f536f22693f (diff)
downloadgit-de9278127e107455fda269d2db280782d77e5eba.tar.gz
Merge branch 'ps/reftable-detach'
Isolates the reftable subsystem from the rest of Git's codebase by using fewer pieces of Git's infrastructure. * 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/reftable-basics.h')
-rw-r--r--reftable/reftable-basics.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/reftable/reftable-basics.h b/reftable/reftable-basics.h
index 6e8e636b71..e0397ed583 100644
--- a/reftable/reftable-basics.h
+++ b/reftable/reftable-basics.h
@@ -11,6 +11,19 @@
#include <stddef.h>
+/*
+ * Hash functions understood by the reftable library. Note that the values are
+ * arbitrary and somewhat random such that we can easily detect cases where the
+ * hash hasn't been properly set up.
+ */
+enum reftable_hash {
+ REFTABLE_HASH_SHA1 = 89,
+ REFTABLE_HASH_SHA256 = 247,
+};
+#define REFTABLE_HASH_SIZE_SHA1 20
+#define REFTABLE_HASH_SIZE_SHA256 32
+#define REFTABLE_HASH_SIZE_MAX REFTABLE_HASH_SIZE_SHA256
+
/* Overrides the functions to use for memory management. */
void reftable_set_alloc(void *(*malloc)(size_t),
void *(*realloc)(void *, size_t), void (*free)(void *));