#include "system.h"
#include "basics.h"
#include "blocksource.h"
#include "reftable-blocksource.h"
#include "reftable-error.h"
static void strbuf_return_block(void *b, struct reftable_block *dest)
{ … }
static void strbuf_close(void *b)
{ … }
static int strbuf_read_block(void *v, struct reftable_block *dest, uint64_t off,
uint32_t size)
{ … }
static uint64_t strbuf_size(void *b)
{ … }
static struct reftable_block_source_vtable strbuf_vtable = …;
void block_source_from_strbuf(struct reftable_block_source *bs,
struct strbuf *buf)
{ … }
static void malloc_return_block(void *b, struct reftable_block *dest)
{ … }
static struct reftable_block_source_vtable malloc_vtable = …;
static struct reftable_block_source malloc_block_source_instance = …;
struct reftable_block_source malloc_block_source(void)
{ … }
struct file_block_source { … };
static uint64_t file_size(void *b)
{ … }
static void file_return_block(void *b, struct reftable_block *dest)
{ … }
static void file_close(void *v)
{ … }
static int file_read_block(void *v, struct reftable_block *dest, uint64_t off,
uint32_t size)
{ … }
static struct reftable_block_source_vtable file_vtable = …;
int reftable_block_source_from_file(struct reftable_block_source *bs,
const char *name)
{ … }