mirror of
https://github.com/git/git.git
synced 2026-01-09 17:46:37 +00:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
ce76cec964
commit
655e18d6b4
@@ -18,13 +18,6 @@
|
||||
|
||||
#define REFTABLE_UNUSED __attribute__((__unused__))
|
||||
|
||||
struct reftable_buf {
|
||||
size_t alloc;
|
||||
size_t len;
|
||||
char *buf;
|
||||
};
|
||||
#define REFTABLE_BUF_INIT { 0 }
|
||||
|
||||
/*
|
||||
* Initialize the buffer such that it is ready for use. This is equivalent to
|
||||
* using REFTABLE_BUF_INIT for stack-allocated variables.
|
||||
|
||||
Reference in New Issue
Block a user