Main Page | Namespace List | Class List | File List | Class Members | Related Pages

src/c-api/xht.h

00001 #ifndef XHT_H
00002 #define XHT_H
00003 
00009 typedef struct xht_struct *xht;
00010 
00016 xht xht_new(int);
00017 
00018 // caller responsible for key storage, no copies made (don't free it b4 xht_free()!)
00019 // set val to NULL to clear an entry, memory is reused but never free'd (# of keys only grows to peak usage)
00020 void xht_set(xht h, const char *key, void *val);
00021 
00022 // ooh! unlike set where key/val is in caller's mem, here they are copied into xht and free'd when val is 0 or xht_free()
00023 void xht_store(xht h, const char *key, int klen, void *val, int vlen);
00024 
00025 // returns value of val if found, or NULL
00026 void *xht_get(xht h, const char *key);
00027 
00028 // free the hashtable and all entries
00029 void xht_free(xht h);
00030 
00031 // pass a function that is called for every key that has a value set
00032 typedef void (*xht_walker)(xht h, const char *key, void *val, void *arg);
00033 void xht_walk(xht h, xht_walker w, void *arg);
00034 
00035 #endif
00036 

Generated on Fri May 19 23:27:33 2006 for Tiny DNSSD by  doxygen 1.4.4