aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/upas/bayes/hash.h
blob: a1cff392f2f963ba0cd3243165f7cc4fe96b5f3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);