The seventh batch
[git.git] / reftable / reftable-basics.h
blobe0397ed5836969f5fb2d1616bc739d4674e2a122
1 /*
2 * Copyright 2020 Google LLC
4 * Use of this source code is governed by a BSD-style
5 * license that can be found in the LICENSE file or at
6 * https://developers.google.com/open-source/licenses/bsd
7 */
9 #ifndef REFTABLE_BASICS_H
10 #define REFTABLE_BASICS_H
12 #include <stddef.h>
15 * Hash functions understood by the reftable library. Note that the values are
16 * arbitrary and somewhat random such that we can easily detect cases where the
17 * hash hasn't been properly set up.
19 enum reftable_hash {
20 REFTABLE_HASH_SHA1 = 89,
21 REFTABLE_HASH_SHA256 = 247,
23 #define REFTABLE_HASH_SIZE_SHA1 20
24 #define REFTABLE_HASH_SIZE_SHA256 32
25 #define REFTABLE_HASH_SIZE_MAX REFTABLE_HASH_SIZE_SHA256
27 /* Overrides the functions to use for memory management. */
28 void reftable_set_alloc(void *(*malloc)(size_t),
29 void *(*realloc)(void *, size_t), void (*free)(void *));
31 #endif