chiark / gitweb /
cdbmodule.c: Fix deallocation.
[python-cdb] / src / cdb_make.h
CommitLineData
dc7ddb87
MW
1/* Public domain. */
2/* Adapted from DJB's original cdb-0.75 package */
3
4#ifndef CDB_MAKE_H
5#define CDB_MAKE_H
6
7#include <stdio.h>
8#include "uint32.h"
9
10#define CDB_HPLIST 1000
11
12struct cdb_hp { uint32 h; uint32 p; } ;
13
14struct cdb_hplist {
15 struct cdb_hp hp[CDB_HPLIST];
16 struct cdb_hplist *next;
17 int num;
18} ;
19
20struct cdb_make {
21 /* char bspace[8192]; */
22 char final[2048];
23 uint32 count[256];
24 uint32 start[256];
25 struct cdb_hplist *head;
26 struct cdb_hp *split; /* includes space for hash */
27 struct cdb_hp *hash;
28 uint32 numentries;
29 /* buffer b; */
30 uint32 pos;
31 /* int fd; */
32 FILE * fp;
33} ;
34
35extern int cdb_make_start(struct cdb_make *, FILE *);
36extern int cdb_make_addbegin(struct cdb_make *,unsigned int,unsigned int);
37extern int cdb_make_addend(struct cdb_make *,unsigned int,unsigned int,uint32);
38extern int cdb_make_add(struct cdb_make *,char *,unsigned int,char *,unsigned int);
39extern int cdb_make_finish(struct cdb_make *);
40
41#endif