irc-bot/cdbmake.h

28 lines
532 B
C
Raw Normal View History

2012-11-20 18:13:16 -07:00
#ifndef __CDBMAKE_H__
#define __CDBMAKE_H__
#include <stdio.h>
#include <stdint.h>
#include <string.h>
struct cdbmake_record {
2012-11-20 20:02:04 -07:00
FILE *f;
2012-11-20 18:13:16 -07:00
uint32_t hashval;
uint32_t offset;
};
struct cdbmake_ctx {
FILE *f;
struct cdbmake_record *records[256];
uint32_t nrecords[256];
2012-11-21 13:10:03 -07:00
long where;
2012-11-20 18:13:16 -07:00
};
void cdbmake_init(struct cdbmake_ctx *ctx, FILE *f);
void cdbmake_add(struct cdbmake_ctx *ctx,
char *key, size_t keylen,
char *val, size_t vallen);
void cdbmake_finalize(struct cdbmake_ctx *ctx);
#endif