CK_HT_ITERATOR_INIT(3)

πŸ’– CK_HT_ITERATOR_INIT πŸ’–

okay bestie so this one lives in the Concurrency Kit β€” that's libck, and you link it with -lck. it's giving ✨concurrent data structures✨ and today we're talking about the little baby that is ck_ht_iterator_init(3).


🌸 NAME 🌸

ck_ht_iterator_init β€” initialize hash table iterator πŸŽ€


πŸ¦‹ LIBRARY πŸ¦‹

Concurrency Kit β€” that's libck, and you compile with -lck. periodt.


✨ SYNOPSIS ✨

#include <ck_ht.h>

ck_ht_iterator_t iterator = CK_HT_ITERATOR_INITIALIZER

void
ck_ht_iterator_init(ck_ht_iterator_t *iterator);

πŸ’… DESCRIPTION πŸ’…

so ck_ht_iterator_init() takes the object that iterator points to and initializes it. that's it. that's the whole job. she's a simple girl and she eats every time πŸ”₯

but wait, there's a second option β€” you can statically initialize an iterator instead, just by handing it the value CK_HT_ITERATOR_INITIALIZER. no function call needed, no drama, just vibes 🌈

and what's an iterator even for, you ask? an iterator is what you use to walk through hash table entries with ck_ht_next(3). it's your little tour guide through the table, lowkey essential, iykyk πŸ‘‘


🫢 RETURN VALUES 🫢

ck_ht_iterator_init() does not return a value. nothing. nada. she simply does the thing and dips πŸ’¨


πŸ’€ ERRORS πŸ’€

this function will not fail. no cap. she cannot fail, she's built different, she's the main character πŸ˜­πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, all in one place:

more tea available at http://concurrencykit.org/ πŸ“


and that's the whole page bestie!! this version is from March 30, 2012, brought to you by Concurrency Kit β€” go forth and iterate, you absolute icon πŸ’œπŸ§šπŸŒΈ

πŸ“¦ where this page comes from