CK_HT_ENTRY_SET(3)

✨ CK_HT_ENTRY_SET(3) ✨

okay bestie, welcome to the ck_ht_entry_set page πŸ’– this one lives in the Concurrency Kit (that's libck, and you link it with -lck btw) and it's genuinely one of the more chill functions in the whole hash table friend group. no drama, no return value, no errors. she just does her thing. iconic behavior honestly πŸŽ€


🌸 NAME 🌸

ck_ht_entry_set β€” initialize a key-value pair

like. that's it. that's the job. she sets an entry. she's the moment. πŸ’…


πŸ¦‹ LIBRARY πŸ¦‹

Concurrency Kit (libck, -lck)


✨ SYNOPSIS ✨

#include <ck_ht.h>

void
ck_ht_entry_set(ck_ht_entry_t *entry, ck_ht_hash_t h, const void *key,
    uint16_t key_length, const void *value);

look at her go. five arguments, zero returns, all vibes. 🌈


πŸ’œ DESCRIPTION πŸ’œ

so here's the tea, bestie πŸ“ β€” ck_ht_entry_set() takes the object that entry points at and initializes it. like, fully glows it up. it gets:

  • a key, which is whatever key points at πŸ‘‘
  • a value, which is whatever value points at πŸ’–
  • and the length of that key, which you hand over in key_length πŸ“

and about that key_length β€” the maximum value it can be is defined by the CK_HT_KEY_LENGTH macro. that's the ceiling. respect the ceiling. no cap (well, actually, cap, but like. the macro one) πŸ™ˆ

now, when do you actually reach for this? the classic move is initializing an entry so you can feed it to ck_ht_set_spmc(3) and ck_ht_put_spmc(3). those are the operations that do stuff with it. ck_ht_entry_set() is the little pre-game ritual ✨

also important: it is expected that this entry will be associated with a hash table that was initialized with CK_HT_MODE_BYTESTRING β€” peep ck_ht_init(3) if you want the full lore. so like, don't just roll up with any old table, she has a type and her type is bytestring mode 🫢


⭐ RETURN VALUES ⭐

ck_ht_entry_set() has no return value.

nothing. void. she gives you nothing and somehow that's still serving πŸ’€


🧚 ERRORS 🧚

This function will never fail.

not "unlikely to fail." not "fails gracefully." never fails. she simply cannot be stopped. main character energy fr fr πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

the whole squad, all of them, no one left behind πŸ’•

Additional information available at http://concurrencykit.org/ 🌐


ok that's the whole page bestie, go forth and initialize your entries responsibly 🫢

and that's a wrap!! this one's from Concurrency Kit, dated March 30, 2012 β€” yeah she's an elder but she's still that girl πŸ’…βœ¨ no cap.

πŸ“¦ where this page comes from