diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-04-07 15:16:21 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-04-07 14:53:11 -0700 |
| commit | 655e18d6b4f845090b0ba4761105b32726893ecb (patch) | |
| tree | cef72db67ee133caed758f3b40f13ba451c38933 /reftable/reftable-basics.h | |
| parent | ce76cec964ed1c8ad6c9fcee9fd833c0ec8cccf9 (diff) | |
| download | git-655e18d6b4f845090b0ba4761105b32726893ecb.tar.xz | |
reftable/block: create public interface for reading blocks
While users of the reftable library wouldn't generally require access to
individual blocks in a reftable table, there are valid usecases where
one may require low-level access to them. One such upcoming usecase in
the Git codebase is to implement consistency checks for the reftable
library where we want to verify each block individually.
Create a public interface for reading blocks. The interface isn't yet
complete and lacks e.g. a way to read individual records from a block.
Such missing functionality will be backfilled in subsequent commits.
Note that this change also requires us to expose `reftable_buf`, which
is used by the `reftable_block_first_key()` function.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/reftable-basics.h')
| -rw-r--r-- | reftable/reftable-basics.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/reftable/reftable-basics.h b/reftable/reftable-basics.h index ed7c7c9ac2..6d73f19c85 100644 --- a/reftable/reftable-basics.h +++ b/reftable/reftable-basics.h @@ -11,6 +11,14 @@ #include <stddef.h> +/* A buffer that contains arbitrary byte slices. */ +struct reftable_buf { + size_t alloc; + size_t len; + char *buf; +}; +#define REFTABLE_BUF_INIT { 0 } + /* * 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 |
