diff options
| author | rsc <devnull@localhost> | 2005-10-29 16:26:32 +0000 |
|---|---|---|
| committer | rsc <devnull@localhost> | 2005-10-29 16:26:32 +0000 |
| commit | d1f529f46f957c78a3db73b42c2fcd2d3c9f8a34 (patch) | |
| tree | a4d6f28106cca984926b9dd5ecddd6053b654617 /src/cmd/upas/bayes/hash.h | |
| parent | 9f1fdc128738b2ed76258ac22a8574c681f3df3a (diff) | |
| download | plan9port-d1f529f46f957c78a3db73b42c2fcd2d3c9f8a34.tar.gz plan9port-d1f529f46f957c78a3db73b42c2fcd2d3c9f8a34.zip | |
Thanks to John Cummings.
Diffstat (limited to 'src/cmd/upas/bayes/hash.h')
| -rw-r--r-- | src/cmd/upas/bayes/hash.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/cmd/upas/bayes/hash.h b/src/cmd/upas/bayes/hash.h new file mode 100644 index 00000000..a1cff392 --- /dev/null +++ b/src/cmd/upas/bayes/hash.h @@ -0,0 +1,27 @@ +typedef struct Stringtab Stringtab; +struct Stringtab { + Stringtab *link; + Stringtab *hash; + char *str; + int n; + int count; + int date; +}; + +typedef struct Hash Hash; +struct Hash +{ + int sorted; + Stringtab **stab; + int nstab; + int ntab; + Stringtab *all; +}; + +Stringtab *findstab(Hash*, char*, int, int); +Stringtab *sortstab(Hash*); + +int Bwritehash(Biobuf*, Hash*); /* destroys hash */ +void Breadhash(Biobuf*, Hash*, int); +void freehash(Hash*); +Biobuf *Bopenlock(char*, int); |
