summaryrefslogtreecommitdiffstats
path: root/src/cmd/upas/bayes/hash.h
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-10-29 16:26:32 +0000
committerrsc <devnull@localhost>2005-10-29 16:26:32 +0000
commitd1f529f46f957c78a3db73b42c2fcd2d3c9f8a34 (patch)
treea4d6f28106cca984926b9dd5ecddd6053b654617 /src/cmd/upas/bayes/hash.h
parent9f1fdc128738b2ed76258ac22a8574c681f3df3a (diff)
downloadplan9port-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.h27
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);