int cdb_make_start(struct cdb *c,int fd);
int cdb_make_add(struct cdb *c,char *key,unsigned int keylen,
char *data,unsigend int datalen);
int cdb_make_finish(struct cdb *c);
cdb_make_add adds entries using the file descriptor fd given as key with length keylen into the cdb returning the hashed values data with length datalen.
cdb_make_finish finalises the data structure provided as fd.
int fd;
stralloc data = {0};
stralloc key = {0};
struct cdb_make c;
if (cdb_make_start(&c,fd) == -1) die_write();
if (cdb_make_add(&c,key.s,key.len,data.s,data.len) == -1)
die_write();
if (cdb_make_finish(&c) == -1) die_write();
if (fsync(fd) == -1) die_write();