#ifndef BLOCK_H
#define BLOCK_H
#include "basics.h"
#include "record.h"
#include "reftable-blocksource.h"
struct block_writer { … };
int block_writer_init(struct block_writer *bw, uint8_t typ, uint8_t *buf,
uint32_t block_size, uint32_t header_off, int hash_size);
uint8_t block_writer_type(struct block_writer *bw);
int block_writer_add(struct block_writer *w, struct reftable_record *rec);
int block_writer_finish(struct block_writer *w);
void block_writer_release(struct block_writer *bw);
struct z_stream;
struct block_reader { … };
int block_reader_init(struct block_reader *br, struct reftable_block *bl,
uint32_t header_off, uint32_t table_block_size,
int hash_size);
void block_reader_release(struct block_reader *br);
uint8_t block_reader_type(const struct block_reader *r);
int block_reader_first_key(const struct block_reader *br, struct reftable_buf *key);
struct block_iter { … };
#define BLOCK_ITER_INIT …
void block_iter_seek_start(struct block_iter *it, const struct block_reader *br);
int block_iter_seek_key(struct block_iter *it, const struct block_reader *br,
struct reftable_buf *want);
int block_iter_next(struct block_iter *it, struct reftable_record *rec);
void block_iter_reset(struct block_iter *it);
void block_iter_close(struct block_iter *it);
int header_size(int version);
int footer_size(int version);
void reftable_block_done(struct reftable_block *ret);
#endif