CK_RHS_GET(3)

πŸ’– CK_RHS_GET(3) πŸ’–

okay bestie, so this page lives in the Concurrency Kit manual, aka libck, and you link against it with -lck. We're talking about ck_rhs_get today and honestly? she's the finder. the girl who knows where everything is. let's go πŸ¦‹


✨ NAME ✨

ck_rhs_get β€” load a key from a hash set πŸ’…


🌸 LIBRARY 🌸

Concurrency Kit (libck, -lck)


πŸŽ€ SYNOPSIS πŸŽ€

#include <ck_rhs.h>

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

πŸ‘‘ DESCRIPTION πŸ‘‘

so the ck_rhs_get(3) function is literally just gonna hand you back a pointer to a key inside the hash set hs β€” specifically a key that's of equivalent value to whatever object key is pointing at. it's giving "found her" energy fr fr.

now, plot twist: the key you pass in is expected to already have the hash value that you're handing over in the hash argument. and that hash? it's supposed to have been generated earlier using the CK_RHS_HASH(3) macro. don't just make one up, bestie, that's not the vibe. πŸ™ˆ


🫢 RETURN VALUES 🫢

  • if the key you gave is a member of hs, you get back a pointer to the key as it's stored inside hs. iconic. ✨
  • if the key wasn't found in hs, you get NULL back. and that's it. that's the whole story. πŸ’€

πŸ’€ ERRORS πŸ’€

ngl this part is the scary part: behavior is undefined if entry or hs are uninitialized. like, uninitialized. do not do it. no cap. 😭

🌈 SEE ALSO 🌈

there's also more lore waiting for you at http://concurrencykit.org/ β€” go drink your water and read the docs πŸ’œ


k that's the whole page bestie, hope it ate πŸ“ this little masterpiece was dated September 17, 2012 and it's filed under CK_RHS_GET(3) in the Concurrency Kit collection. mwah, bye πŸ’–βœ¨

πŸ“¦ where this page comes from