CK_RHS_REMOVE(3)

πŸ’… CK_RHS_REMOVE β€” remove key from a hash set

okay bestie, welcome to the CK_RHS_REMOVE(3) page, part of the Concurrency Kit manuals. this one's about ✨yeeting a key out of a hash set✨. let's get into it 🫢


🌸 LIBRARY

Concurrency Kit β€” that's libck, and you link it with -lck. iconic behavior, no notes πŸ’–


✨ SYNOPSIS ✨

#include <ck_rhs.h>

void *
ck_rhs_remove(ck_rhs_t *hs, unsigned long hash, const void *key);

πŸ¦‹ DESCRIPTION

so, the ck_rhs_remove(3) function is gonna try to remove the key you pass in as the key argument, out of the hash set that hs points to. the way that key has to already come with a hash value β€” the one you give it in the hash argument β€” and that hash was supposed to be generated earlier using the CK_RHS_HASH(3) macro. so like, pre-computed, bestie, don't just make one up πŸ™ˆ

if the ck_rhs_remove(3) call popped off successfully, then the key that was chillin' in the hash set gets returned to you. but if that key wasn't a member of the hash set in the first place? you get NULL. that's it, that's the vibe πŸ’€


πŸŽ€ RETURN VALUES

when it succeeds, ck_rhs_remove(3) hands you back a pointer to a key. otherwise, on failure, it returns NULL. simple as 🌸


πŸ’œ ERRORS

behavior is undefined if key or hs are uninitialized. like, unhinged territory. don't do it. 🚫

πŸ‘‘ SEE ALSO

ck_rhs_init(3), ck_rhs_move(3), ck_rhs_destroy(3), CK_RHS_HASH(3), ck_rhs_iterator_init(3), ck_rhs_next(3), ck_rhs_get(3), ck_rhs_put(3), ck_rhs_put_unique(3), ck_rhs_set(3), ck_rhs_fas(3), ck_rhs_grow(3), ck_rhs_gc(3), ck_rhs_rebuild(3), ck_rhs_count(3), ck_rhs_reset(3), ck_rhs_reset_size(3), ck_rhs_stat(3)

and if you want even more, there's extra info waiting for you at http://concurrencykit.org/ 🌈


that's the whole page, bestie β€” slay πŸ’…βœ¨

this one's from Concurrency Kit, and it's dated September 17, 2012 πŸŽ€ mwah, ily, go remove some keys responsibly πŸ«ΆπŸ’–

πŸ“¦ where this page comes from