aboutsummaryrefslogtreecommitdiff
path: root/reftable/reftable-block.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-04-07 15:16:24 +0200
committerJunio C Hamano <gitster@pobox.com>2025-04-07 14:53:12 -0700
commit50d845947734f45970439518047ab1f79628bb7e (patch)
treecbb5b4c6dbf3de67d7f2aed6ecee5a3d7961cbfb /reftable/reftable-block.h
parent6da48a5e00ae77c4092e78ac8ac8641a90660343 (diff)
downloadgit-50d845947734f45970439518047ab1f79628bb7e.tar.xz
reftable/block: expose a generic iterator over reftable records
Expose a generic iterator over reftable records and expose it via the public interface. Together with an upcoming iterator for reftable blocks contained in a table this will allow users to trivially iterate through blocks and their respective records individually. This functionality will be used to implement consistency checks for the reftable backend, which requires more fine-grained control over how we read data. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/reftable-block.h')
-rw-r--r--reftable/reftable-block.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/reftable/reftable-block.h b/reftable/reftable-block.h
index 13bd68be8c..04c3b518c8 100644
--- a/reftable/reftable-block.h
+++ b/reftable/reftable-block.h
@@ -13,6 +13,7 @@
#include "reftable-basics.h"
#include "reftable-blocksource.h"
+#include "reftable-iterator.h"
struct z_stream_s;
@@ -60,6 +61,10 @@ int reftable_block_init(struct reftable_block *b,
/* Release resources allocated by the block. */
void reftable_block_release(struct reftable_block *b);
+/* Initialize a generic record iterator from the given block. */
+int reftable_block_init_iterator(const struct reftable_block *b,
+ struct reftable_iterator *it);
+
/* Returns the block type (eg. 'r' for refs). */
uint8_t reftable_block_type(const struct reftable_block *b);