2014-09-04 07:44:53 +04:00
|
|
|
/* include/g/h.h
|
|
|
|
**
|
|
|
|
** This file is in the public domain.
|
|
|
|
*/
|
|
|
|
/** Functions.
|
|
|
|
***
|
|
|
|
*** Needs: delete and merge functions; clock reclamation function.
|
|
|
|
**/
|
2014-09-06 00:13:24 +04:00
|
|
|
/* u3_ch_new(): create hashtable.
|
2014-09-04 07:44:53 +04:00
|
|
|
*/
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_ch_root*
|
|
|
|
u3_ch_new(void);
|
2014-09-04 07:44:53 +04:00
|
|
|
|
2014-09-06 00:13:24 +04:00
|
|
|
/* u3_ch_put(): insert in hashtable.
|
2014-09-04 07:44:53 +04:00
|
|
|
**
|
|
|
|
** `key` is RETAINED; `val` is transferred.
|
|
|
|
*/
|
|
|
|
void
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_ch_put(u3_ch_root* har_u, u3_noun key, u3_noun val);
|
2014-09-04 07:44:53 +04:00
|
|
|
|
2014-09-06 00:13:24 +04:00
|
|
|
/* u3_ch_get(): read from hashtable.
|
2014-09-04 07:44:53 +04:00
|
|
|
**
|
|
|
|
** `key` is RETAINED.
|
|
|
|
*/
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_weak
|
|
|
|
u3_ch_get(u3_ch_root* har_u, u3_noun key);
|
2014-09-04 07:44:53 +04:00
|
|
|
|
2014-10-09 02:16:24 +04:00
|
|
|
/* u3_ch_gut(): read from hashtable, unifying key nouns.
|
|
|
|
**
|
|
|
|
** `key` is RETAINED.
|
|
|
|
*/
|
|
|
|
u3_weak
|
|
|
|
u3_ch_gut(u3_ch_root* har_u, u3_noun key);
|
|
|
|
|
2014-09-06 00:13:24 +04:00
|
|
|
/* u3_ch_free(): free hashtable.
|
2014-09-04 07:44:53 +04:00
|
|
|
*/
|
|
|
|
void
|
2014-09-06 00:13:24 +04:00
|
|
|
u3_ch_free(u3_ch_root* har_u);
|
2014-09-04 07:44:53 +04:00
|
|
|
|
2014-10-09 06:20:57 +04:00
|
|
|
/* u3_ch_mark(): mark hashtable for gc.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
u3_ch_mark(u3_ch_root* har_u);
|
2014-10-31 00:40:05 +03:00
|
|
|
|
|
|
|
/* u3_ch_walk(): traverse hashtable with key, value fn; RETAINS.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
u3_ch_walk(u3_ch_root* har_u, void (*fun_f)(u3_noun));
|