CK_RHS_NEXT(3)
β¨ ck_rhs_next β iterate to next entry in hash set β¨
okay bestie, we're in the ck_rhs_next page from the Concurrency Kit manual, and honestly? it's giving "tiny function, big responsibilities" π
π LIBRARY
Concurrency Kit, aka libck, link it with -lck. that's the whole vibe. π
π¦ SYNOPSIS
#include <ck_rhs.h>
bool
ck_rhs_next(ck_rhs_t *hs, ck_rhs_iterator_t *iterator, void **entry);
π DESCRIPTION
so ck_rhs_next(3) does one thing and it does it iconically: it bumps the iterator object that iterator points at, so it lands on the next non-empty hash set entry. like, it skips past all the empty slots because we do not have time for those. periodt.
and if ck_rhs_next(3) returns true? then the pointer that entry points at gets initialized to the current hash set key that the iterator object is sitting on. it's literally handing you the key. so generous of it. π«Ά
β οΈ important, bestie:iteratoris expected to have already been initialized using theck_rhs_iterator_init(3)function, or statically initialized usingCK_RHS_ITERATOR_INITIALIZER. you can't just roll up with a random uninitialized iterator and expect magic. that's not how any of this works. π
πΈ RETURN VALUES
- if
ck_rhs_next(3)returnstrueβ slay! π the object thatentrypoints at points to a valid hash set key. you're so back. - if
ck_rhs_next(3)returnsfalseβ oop π the value of the object thatentrypoints at is undefined. do not look at it. do not touch it. it's not for you.
π ERRORS
behavior is undefined if iterator or hs are uninitialized. like, genuinely undefined. no promises, no guarantees, no nothing. consider this your vibe check warning. π¨
π SEE ALSO
the whole squad, fr fr:
ck_rhs_init(3),ck_rhs_move(3),ck_rhs_destroy(3),CK_RHS_HASH(3)ck_rhs_iterator_init(3),ck_rhs_get(3),ck_rhs_put(3),ck_rhs_put_unique(3)ck_rhs_set(3),ck_rhs_fas(3),ck_rhs_remove(3),ck_rhs_grow(3)ck_rhs_rebuild(3),ck_rhs_gc(3),ck_rhs_count(3),ck_rhs_reset(3)ck_rhs_reset_size(3),ck_rhs_stat(3)
and if you want even more lore, additional information is available at http://concurrencykit.org/ π
okay that's the whole page, you ate it up π
this one's from September 17, 2012 (yes it's been iconic since 2012, we love an ageless queen) and it lives under the name CK_RHS_NEXT(3). go forth and iterate, bestie π¦β¨π
π¦ where this page comes from
- alpine 3.24: ck-doc 0.7.2-r1 Β· BSD-2-Clause AND Apache-2.0
- debian bookworm: libck-dev 0.7.1-10 Β· BSD-2-Clause
- debian trixie: libck-dev 0.7.2-6 Β· BSD-2-Clause
- epel 10: ck-devel 0.7.2-1.el10_1 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- epel 9: ck-devel 0.7.0-10.el9 Β· BSD
- fedora 43: ck-devel 0.7.2-2.fc43 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 43: ck-devel 0.7.2-2.fc43 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 44: ck-devel 0.7.2-4.fc44 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- fedora 44: ck-devel 0.7.2-4.fc44 Β· BSD-2-clause AND Apache-2.0 AND BSD-3-clause
- nixos 26.05: ck 0.7.2
- nixpkgs unstable: ck 0.7.2
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- opensuse-leap 16.0: ck-devel 0.7.2-bp160.1.9 Β· Apache-2.0 AND BSD-2-Clause
- ubuntu jammy: libck-dev 0.7.1-6ubuntu2 Β· BSD-2-Clause
- ubuntu noble: libck-dev 0.7.1-13build1 Β· BSD-2-Clause
- ubuntu questing: libck-dev 0.7.2-5ubuntu1
- ubuntu resolute: libck-dev 0.7.2-5ubuntu2 Β· BSD-2-Clause
- ubuntu stonking: libck-dev 0.7.2-11 Β· BSD-2-Clause
- Copyright 2012-2013 Samy Al Bahra
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms