X-Git-Url: https://git.distorted.org.uk/~mdw/mLib/blobdiff_plain/18c831dcd0ae4d660c70ccac69d27ed2a97851be..882a39c1c269818ed00b1b600180c1d22e8ee0d2:/struct/hash.3 diff --git a/struct/hash.3 b/struct/hash.3 index 5869d89..19522ee 100644 --- a/struct/hash.3 +++ b/struct/hash.3 @@ -38,11 +38,24 @@ hash \- low-level hashtable implementation .nf .B "#include " +.B "typedef struct {" +.B "\h'4n'uint32 mask;" +.B "\h'4n'hash_base **v;" +.B "\h'4n'arena *a;" +.B "} hash_table;" + +.B "typedef struct {" +.B "\h'4n'hash_base *next;" +.B "\h'4n'uint32 hash;" +.B "} hash_base;" + +.B "typedef struct { ...\& } hash_iter;" + .BI "void hash_create(hash_table *" t ", size_t " n ); .BI "void hash_destroy(hash_table *" t ); .BI "hash_base **hash_bin(hash_table *" t ", uint32 " hash ); .BI "int hash_extend(hash_table *" t ); -.BI "void hash_remove(hash_table *" t ", hash_base * " b ); +.BI "void hash_remove(hash_table *" t ", hash_base *" b ); .BI "void hash_mkiter(hash_iter *" i ", hash_table *" t ); .BI "hash_base *hash_next(hash_iter *" i );