#include #include #include #include #include "hash.h" typedef struct TestHash TestHash; struct TestHash { HashItem; char name[40]; }; void threadmain(int argc, char **argv) { Hash *h; TestHash *th, *rv; ARGBEGIN{ }ARGEND inithash(); h = newhash(); th = mallocz(sizeof(*th), 1); strcpy(th->name, "bar"); rv = gethash(h, "foo"); print("foo = %#p\n", rv); puthash(h, "foo", th); rv = gethash(h, "foo"); print("foo = %#p %s\n", rv, rv->name); threadexitsall(nil); }