CK_HS_NEXT(3)
π CK_HS_NEXT(3) β ck_hs_next π
okay bestie, gather round, we're learning about ck_hs_next from the Concurrency Kit manual, section 3 π¦
π LIBRARY
this lil cutie lives in Concurrency Kit, aka libck, and you link it with -lck. periodt. π
β¨ SYNOPSIS β¨
#include <ck_hs.h>
bool
ck_hs_next(ck_hs_t *hs, ck_hs_iterator_t *iterator, void **entry);
look at her. she's giving three arguments and a bool return. iconic. πΈ
π DESCRIPTION π
so the way that ck_hs_next(3) works is: it bumps the iterator object that iterator points to, so it's now pointing at the next non-empty hash set entry. it's literally just walking you forward through the set, one living entry at a time. no cap. πΆββοΈβ¨
and if ck_hs_next(3) returns true, then the pointer that entry points to gets initialized to the current hash set key that the iterator object is pointing at. so you get the goods. π
bestie, heads up:iteratoris expected to have been initialized already, either withck_hs_iterator_init(3)or statically withCK_HS_ITERATOR_INITIALIZER. don't just roll up with a random uninitialized iterator, that's not the vibe. π
π« RETURN VALUES π«
- if
ck_hs_next(3)returnstrue, then the object pointed to byentrypoints to a valid hash set key. yay, you ate. π - if
ck_hs_next(3)returnsfalse, then the value of the object pointed to byentryis undefined. so likeβ¦ don't trust it, don't look at it, don't text it back. π
π ERRORS π
behavior is undefined ifiteratororhsare uninitialized. fr fr, undefined. not "kinda weird", not "slightly off" β undefined. do not pass go. π«
π SEE ALSO π
the whole friend group, all linked up:
ck_hs_init(3)ck_hs_move(3)ck_hs_destroy(3)CK_HS_HASH(3)ck_hs_iterator_init(3)ck_hs_get(3)ck_hs_put(3)ck_hs_put_unique(3)ck_hs_set(3)ck_hs_fas(3)ck_hs_remove(3)ck_hs_grow(3)ck_hs_rebuild(3)ck_hs_gc(3)ck_hs_count(3)ck_hs_reset(3)ck_hs_reset_size(3)ck_hs_stat(3)
and if you want even more lore, it's all waiting for you at http://concurrencykit.org/ π«Ά
September 17, 2012 is when this queen was documented, and she's serving from CK_HS_NEXT(3) in the Concurrency Kit manual. mwah. π stay iterating, 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