plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

hash.h (470B)


      1 typedef struct Stringtab	Stringtab;
      2 struct Stringtab {
      3 	Stringtab *link;
      4 	Stringtab *hash;
      5 	char *str;
      6 	int n;
      7 	int count;
      8 	int date;
      9 };
     10 
     11 typedef struct Hash Hash;
     12 struct Hash
     13 {
     14 	int sorted;
     15 	Stringtab **stab;
     16 	int nstab;
     17 	int ntab;
     18 	Stringtab *all;
     19 };
     20 
     21 Stringtab *findstab(Hash*, char*, int, int);
     22 Stringtab *sortstab(Hash*);
     23 
     24 int Bwritehash(Biobuf*, Hash*);	/* destroys hash */
     25 void Breadhash(Biobuf*, Hash*, int);
     26 void freehash(Hash*);
     27 Biobuf *Bopenlock(char*, int);