summaryrefslogtreecommitdiff
path: root/reftable/constants.h
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2021-10-07 20:25:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-10-08 17:45:48 (GMT)
commite303bf22f9ac1a3bf0cb384ecd925570e014a3f3 (patch)
tree33c5d87321c1da7e6b8eaf175e4c702997a8a3f2 /reftable/constants.h
parent1214aa841bc825c97541a68f397227cb2bfd3f3c (diff)
downloadgit-e303bf22f9ac1a3bf0cb384ecd925570e014a3f3.zip
git-e303bf22f9ac1a3bf0cb384ecd925570e014a3f3.tar.gz
git-e303bf22f9ac1a3bf0cb384ecd925570e014a3f3.tar.bz2
reftable: (de)serialization for the polymorphic record type.
The reftable format is structured as a sequence of blocks, and each block contains a sequence of prefix-compressed key-value records. There are 4 types of records, and they have similarities in how they must be handled. This is achieved by introducing a polymorphic 'record' type that encapsulates ref, log, index and object records. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/constants.h')
-rw-r--r--reftable/constants.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/reftable/constants.h b/reftable/constants.h
new file mode 100644
index 0000000..5eee72c
--- /dev/null
+++ b/reftable/constants.h
@@ -0,0 +1,21 @@
+/*
+Copyright 2020 Google LLC
+
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file or at
+https://developers.google.com/open-source/licenses/bsd
+*/
+
+#ifndef CONSTANTS_H
+#define CONSTANTS_H
+
+#define BLOCK_TYPE_LOG 'g'
+#define BLOCK_TYPE_INDEX 'i'
+#define BLOCK_TYPE_REF 'r'
+#define BLOCK_TYPE_OBJ 'o'
+#define BLOCK_TYPE_ANY 0
+
+#define MAX_RESTARTS ((1 << 16) - 1)
+#define DEFAULT_BLOCK_SIZE 4096
+
+#endif