mirror of
https://github.com/urbit/shrub.git
synced 2025-01-03 01:54:43 +03:00
style
This commit is contained in:
parent
44dfc2118a
commit
65e621150f
@ -2,10 +2,40 @@
|
||||
**
|
||||
** This file is in the public domain.
|
||||
*/
|
||||
struct u2_nash;
|
||||
|
||||
struct u2_nash* u2_na_make();
|
||||
void u2_na_put(struct u2_nash* nash, u2_noun key, u2_noun val);
|
||||
u2_weak u2_na_get(struct u2_nash* nash, u2_noun key);
|
||||
void u2_na_take(struct u2_nash* nash);
|
||||
/** Hash-table design:
|
||||
***
|
||||
*** u2_nash is a non-noun hash-table, meant for ephemeral usage such as
|
||||
*** in jam and cue.
|
||||
***
|
||||
*** It uses a Patricia trie keyed on the mug of the actual key, and then
|
||||
*** a vector of key-value pairs to resolve collisions.
|
||||
**/
|
||||
|
||||
/* Opaque structure holding hash table.
|
||||
*/
|
||||
struct u2_nash;
|
||||
|
||||
/* Functions
|
||||
*/
|
||||
|
||||
/* u2_na_make(): create a new nash.
|
||||
*/
|
||||
struct u2_nash*
|
||||
u2_na_make();
|
||||
|
||||
/* u2_na_put(): put an entry in the hash table.
|
||||
*/
|
||||
void
|
||||
u2_na_put(struct u2_nash* nash, u2_noun key, u2_noun val);
|
||||
|
||||
/* u2_na_get(): retrieve an entry from the hash table, or u2_none.
|
||||
*/
|
||||
u2_weak
|
||||
u2_na_get(struct u2_nash* nash, u2_noun key);
|
||||
|
||||
/* u2_na_take(): destroy a nash.
|
||||
*/
|
||||
void
|
||||
u2_na_take(struct u2_nash* nash);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user