Plan 9 from Bell Labs’s /usr/web/sources/contrib/mycroftiv/unreleased/listfs/dbstructs.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


/* requires mp.h and libsec.h */

typedef struct Frlist 	Frlist;
typedef struct Htab	Htab;
typedef struct Hent 	Hent;


struct Frlist{
	char* listname;
	void* obj;
	char* objtype;
	char* objname;
	uint objsize;
	Frlist* first;
	Frlist* prev;
	Frlist* next;
	Frlist* final;
	uint index;
};

struct Htab{
	void* parent;
	char* name;
	uint entries;
	Frlist* entlist;
};

struct Hent{
	Htab* parent;
	Frlist* ent;
	uint index;
	char* key;
	uchar hval[MD5dlen];
	char* asciihash;
	void* obj;
	uint objsize;
	void *owner;
};

Frlist* initl(char* objtype, uint objsize, char* objname, void* obj, char *listname);
Frlist* putl(char* objtype, uint objsize, char* objname, void* obj, Frlist* old);
Frlist* preputl(char* objtype, uint objsize, char* objname, void* obj, Frlist* old);
Frlist* getnuml(uint num, Frlist* old);
Frlist* reml(Frlist* f);
void clearl(Frlist* f);

Htab* htinit(void* obj, uint size, char* key, char* htabname);
Hent* htput(void* obj, uint size, char* key, Htab* ht);
Hent* htgetbykey(char* key, Htab* ht);
Hent* htgetbyhash(uchar hash[MD5dlen], Htab* ht);
Hent* htgetbygrep(char* grepfor, Htab* ht);
Hent* htgetbyindex(uint index, Htab *ht);
Hent* htdropent(Hent* old);
void htcleartab(Htab* ht);

char* hashconv(char* hash);

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.