/* Bio-Digital persistent sidecar delta file. */
#ifndef BIO_BDL_H_
#define BIO_BDL_H_

#include <stddef.h>
#include <stdint.h>

#include "bio/bio.h"

#define BIO_BDL_MAGIC 0x314c4442u

bio_v1_status bio_bdl_save(const char *path, const int8_t *delta, size_t delta_len,
                           uint64_t steps);
bio_v1_status bio_bdl_load(const char *path, int8_t *delta, size_t delta_len,
                           uint64_t *steps_out);
uint64_t bio_bdl_checksum(const int8_t *delta, size_t delta_len);
uint64_t bio_bdl_file_size(const char *path);
bio_v1_status bio_bdl_append_learn_page(const char *path, const int8_t *delta,
                                        size_t delta_len, uint64_t step,
                                        size_t page_bytes);
bio_v1_status bio_bdl_prune_pages(const char *path, uint64_t keep_bytes);

#endif /* BIO_BDL_H_ */
