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 b has to point to a void pointer

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 πŸ‘‘

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