![]() |
kinetic-c
v0.12.0
Seagate Kinetic Protocol Client Library for C
|
Go to the source code of this file.
Macros | |
| #define | LOG(...) |
| #define | DEF_SZ2 4 |
| #define | MAX_PROBES 16 |
| #define | LARGE_PRIME (4294967291L /* (2 ** 32) - 5 */) |
Functions | |
| static bool | insert (int *buckets, void **values, size_t mask, size_t max_fill, int key, void *value, void **old_value) |
| static bool | grow (struct yacht *y) |
| struct yacht * | Yacht_Init (uint8_t sz2) |
| Init a hash table with approx. More... | |
| static size_t | hash (int key) |
| bool | Yacht_Get (struct yacht *y, int key, void **value) |
| Get KEY from the table, setting *value if found. More... | |
| bool | Yacht_Member (struct yacht *y, int key) |
| Check if KEY is in the table. More... | |
| bool | Yacht_Set (struct yacht *y, int key, void *value, void **old_value) |
| Set KEY to VALUE in the table. More... | |
| bool | Yacht_Remove (struct yacht *y, int key, void **old_value) |
| Remove KEY from the table. More... | |
| void | Yacht_Free (struct yacht *y, Yacht_Free_cb *cb, void *udata) |
| Free the table. More... | |
|
static |
Definition at line 111 of file yacht.c.
References hash(), LOG, yacht::mask, YACHT_DELETED, and YACHT_NO_KEY.
|
static |
Definition at line 134 of file yacht.c.
References yacht::buckets, insert(), LOG, yacht::mask, yacht::size, yacht::values, YACHT_DELETED, and YACHT_NO_KEY.
| struct yacht* Yacht_Init | ( | uint8_t | sz2 | ) |
Init a hash table with approx.
2 ** sz2 buckets.
Definition at line 41 of file yacht.c.
References yacht::buckets, DEF_SZ2, LOG, yacht::mask, yacht::size, yacht::values, and YACHT_NO_KEY.
|
static |
Definition at line 69 of file yacht.c.
References LARGE_PRIME.
| bool Yacht_Get | ( | struct yacht * | y, |
| int | key, | ||
| void ** | value | ||
| ) |
Get KEY from the table, setting *value if found.
Definition at line 73 of file yacht.c.
References yacht::buckets, hash(), LOG, yacht::mask, yacht::size, yacht::values, YACHT_DELETED, and YACHT_NO_KEY.
| bool Yacht_Member | ( | struct yacht * | y, |
| int | key | ||
| ) |
Check if KEY is in the table.
Definition at line 91 of file yacht.c.
References LOG, and Yacht_Get().
| bool Yacht_Set | ( | struct yacht * | y, |
| int | key, | ||
| void * | value, | ||
| void ** | old_value | ||
| ) |
Set KEY to VALUE in the table.
Definition at line 97 of file yacht.c.
References yacht::buckets, grow(), insert(), LOG, yacht::mask, MAX_PROBES, yacht::size, and yacht::values.
| bool Yacht_Remove | ( | struct yacht * | y, |
| int | key, | ||
| void ** | old_value | ||
| ) |
Remove KEY from the table.
RetuBus_RegisterSocket the old value in *old_value, if non-NULL.
Definition at line 174 of file yacht.c.
References yacht::buckets, hash(), LOG, yacht::mask, yacht::size, yacht::values, YACHT_DELETED, and YACHT_NO_KEY.
| void Yacht_Free | ( | struct yacht * | y, |
| Yacht_Free_cb * | cb, | ||
| void * | udata | ||
| ) |
Free the table.
Definition at line 202 of file yacht.c.
References yacht::buckets, yacht::size, yacht::values, YACHT_DELETED, and YACHT_NO_KEY.
1.8.8