X-Git-Url: https://git.distorted.org.uk/~mdw/mLib/blobdiff_plain/db0e70a131f1a3a28cc78cface5b5db87b0d5416..4729aa69dab96d801f2767be4b254997c21d1d32:/struct/hash.3 diff --git a/struct/hash.3 b/struct/hash.3 index 6093258..19522ee 100644 --- a/struct/hash.3 +++ b/struct/hash.3 @@ -38,6 +38,19 @@ 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 );