Mercurial > hg > cdb
comparison cdb_make.h @ 0:2cb46628feec
from cdb-0.75 per http://cr.yp.to/cdb.html,
retrieved 2025-01-03,
contents appear to have been create on 2000-02-19
| author | Henry S. Thompson <ht@inf.ed.ac.uk> |
|---|---|
| date | Wed, 29 Jan 2025 10:50:34 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:2cb46628feec |
|---|---|
| 1 /* Public domain. */ | |
| 2 | |
| 3 #ifndef CDB_MAKE_H | |
| 4 #define CDB_MAKE_H | |
| 5 | |
| 6 #include "buffer.h" | |
| 7 #include "uint32.h" | |
| 8 | |
| 9 #define CDB_HPLIST 1000 | |
| 10 | |
| 11 struct cdb_hp { uint32 h; uint32 p; } ; | |
| 12 | |
| 13 struct cdb_hplist { | |
| 14 struct cdb_hp hp[CDB_HPLIST]; | |
| 15 struct cdb_hplist *next; | |
| 16 int num; | |
| 17 } ; | |
| 18 | |
| 19 struct cdb_make { | |
| 20 char bspace[8192]; | |
| 21 char final[2048]; | |
| 22 uint32 count[256]; | |
| 23 uint32 start[256]; | |
| 24 struct cdb_hplist *head; | |
| 25 struct cdb_hp *split; /* includes space for hash */ | |
| 26 struct cdb_hp *hash; | |
| 27 uint32 numentries; | |
| 28 buffer b; | |
| 29 uint32 pos; | |
| 30 int fd; | |
| 31 } ; | |
| 32 | |
| 33 extern int cdb_make_start(struct cdb_make *,int); | |
| 34 extern int cdb_make_addbegin(struct cdb_make *,unsigned int,unsigned int); | |
| 35 extern int cdb_make_addend(struct cdb_make *,unsigned int,unsigned int,uint32); | |
| 36 extern int cdb_make_add(struct cdb_make *,char *,unsigned int,char *,unsigned int); | |
| 37 extern int cdb_make_finish(struct cdb_make *); | |
| 38 | |
| 39 #endif |
