EC_DICT_ITER_GET_VAL(3)

✨ EC_DICT_ITER_GET_VAL(3) ✨

okay so this is a page from the Libecoli Programmer's Manual, and it's all about one tiny little function that does one tiny little thing β€” but bestie, that thing is useful. 🫢


πŸ’– NAME πŸ’–

ec_dict_iter_get_val β€” grab the value of the element your iterator is currently sitting on. that's it. that's the whole job. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <ecoli/dict.h>

void * ec_dict_iter_get_val(
    const struct ec_dict_elt_ref   *iter   /* The hash table iterator. */
);

so you pull in the header, hand it your iterator, and it hands you back a void *. the parameter is iter β€” the hash table iterator. literally just the iterator. that's the whole vibe. ✨


πŸ¦‹ RETURN VALUE πŸ¦‹

it gives you back the value of the current element. slay. πŸ’…

but β€” and this is the important part, no cap β€” if the iterator is pointing at something that isn't a valid element, you get NULL back instead. so like, check it before you go dereferencing it, bestie. it's giving "trust but verify". 😭

fr fr: NULL is a real possible answer here, not an error code. handle it.

πŸŽ€ SEE ALSO πŸŽ€

the whole girl gang, all together:

go read them too, they're all iconic. 🌈


Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.


and that's the whole page, bestie!! πŸ“ this was libecoli, dated 2026-06-11, and honestly? she ate. go forth and iterate. πŸ§šπŸ’–

πŸ“¦ where this page comes from