CK_ARRAY_FOREACH(3)
π CK_ARRAY_FOREACH(3) π
okay so bestie, welcome to the Concurrency Kit manual β this one's CK_ARRAY_FOREACH, and it's about to be your new fave little loop. no cap.
β¨ NAME β¨
CK_ARRAY_FOREACH β iterate through an array π¦
π LIBRARY π
Concurrency Kit (that's libck, and you link it with -lck) π
πΈ SYNOPSIS πΈ
#include <ck_array.h>
bool
CK_ARRAY_FOREACH(ck_array_t *array, ck_array_iterator_t *iterator,
void **b);
π DESCRIPTION π
So the CK_ARRAY_FOREACH(3) macro? it literally walks through the array that array points at. main character energy, honestly.
- you gotta hand it a pointer to an iterator object, and that goes in
iterator - and
bhas to point to avoidpointer
that's it. that's the whole vibe check. π
π EXAMPLE π
#include <ck_array.h>
/* Assume this was already previously initialized. */
ck_array_t array;
void
example(void)
{
ck_array_iterator_t iterator;
void *pointer;
CK_ARRAY_FOREACH(&array, &iterator, &pointer) {
do_something(pointer);
}
}
look at her go πβ¨
β RETURN VALUES β
ngl, this macro has no return value. it just does its thing and leaves. periodt. π
π SEE ALSO π
ck_array_init(3)ck_array_commit(3)ck_array_put(3)ck_array_put_unique(3)ck_array_remove(3)ck_array_deinit(3)ck_array_length(3)ck_array_buffer(3)ck_array_initialized(3)
Additional information available at http://concurrencykit.org/ π«Ά
k bye bestie, that's the whole page β Concurrency Kit, dated October 18, 2013, and this was CK_ARRAY_FOREACH(3). go iterate something iconic πππ§
π¦ 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 2013 Samy Al Bahra
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms