diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-10-17 06:53:59 +0200 |
---|---|---|
committer | Taylor Blau <me@ttaylorr.com> | 2024-10-17 22:59:56 +0200 |
commit | f177d491637a3771f19055cb3873bda9c163c91a (patch) | |
tree | 1c34bed0a2f4089aa5aabc13f0fd216111c6fdbe /reftable | |
parent | reftable: convert from `strbuf` to `reftable_buf` (diff) | |
download | git-f177d491637a3771f19055cb3873bda9c163c91a.tar.xz git-f177d491637a3771f19055cb3873bda9c163c91a.zip |
reftable/blocksource: adapt interface name
Adapt the name of the `strbuf` block source to no longer relate to this
interface, but instead to the `reftable_buf` interface.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'reftable')
-rw-r--r-- | reftable/blocksource.c | 26 | ||||
-rw-r--r-- | reftable/blocksource.h | 4 |
2 files changed, 15 insertions, 15 deletions
diff --git a/reftable/blocksource.c b/reftable/blocksource.c index d6242d6790..52e0915a67 100644 --- a/reftable/blocksource.c +++ b/reftable/blocksource.c @@ -13,19 +13,19 @@ https://developers.google.com/open-source/licenses/bsd #include "reftable-blocksource.h" #include "reftable-error.h" -static void strbuf_return_block(void *b UNUSED, struct reftable_block *dest) +static void reftable_buf_return_block(void *b UNUSED, struct reftable_block *dest) { if (dest->len) memset(dest->data, 0xff, dest->len); reftable_free(dest->data); } -static void strbuf_close(void *b UNUSED) +static void reftable_buf_close(void *b UNUSED) { } -static int strbuf_read_block(void *v, struct reftable_block *dest, uint64_t off, - uint32_t size) +static int reftable_buf_read_block(void *v, struct reftable_block *dest, + uint64_t off, uint32_t size) { struct reftable_buf *b = v; assert(off + size <= b->len); @@ -37,23 +37,23 @@ static int strbuf_read_block(void *v, struct reftable_block *dest, uint64_t off, return size; } -static uint64_t strbuf_size(void *b) +static uint64_t reftable_buf_size(void *b) { return ((struct reftable_buf *)b)->len; } -static struct reftable_block_source_vtable strbuf_vtable = { - .size = &strbuf_size, - .read_block = &strbuf_read_block, - .return_block = &strbuf_return_block, - .close = &strbuf_close, +static struct reftable_block_source_vtable reftable_buf_vtable = { + .size = &reftable_buf_size, + .read_block = &reftable_buf_read_block, + .return_block = &reftable_buf_return_block, + .close = &reftable_buf_close, }; -void block_source_from_strbuf(struct reftable_block_source *bs, - struct reftable_buf *buf) +void block_source_from_buf(struct reftable_block_source *bs, + struct reftable_buf *buf) { assert(!bs->ops); - bs->ops = &strbuf_vtable; + bs->ops = &reftable_buf_vtable; bs->arg = buf; } diff --git a/reftable/blocksource.h b/reftable/blocksource.h index ee3647c653..a84a3ccd89 100644 --- a/reftable/blocksource.h +++ b/reftable/blocksource.h @@ -15,7 +15,7 @@ struct reftable_block_source; struct reftable_buf; /* Create an in-memory block source for reading reftables */ -void block_source_from_strbuf(struct reftable_block_source *bs, - struct reftable_buf *buf); +void block_source_from_buf(struct reftable_block_source *bs, + struct reftable_buf *buf); #endif |