EC_DICT_ITER(3)
π ec_dict_iter(3) β Libecoli Programmer's Manual π
okay bestie, welcome to the ec_dict_iter page, straight outta the Libecoli Programmer's Manual, and no cap this one is a lil cutie π
β¨ NAME β¨
ec_dict_iter β iterate the elements in the hash table. yes bestie, it's a walk-the-dict situation π
πΈ SYNOPSIS πΈ
#include <ecoli/dict.h>
struct ec_dict_elt_ref * ec_dict_iter(
const struct ec_dict *dict /* The hash table. */
);
so you pull in <ecoli/dict.h>, hand it your hash table, and it hands you back a struct ec_dict_elt_ref *. iconic behavior honestly π«Ά
π¦ DESCRIPTION π¦
the typical usage is as below β this is the moment, the main character loop, the one you're gonna be typing over and over:
for (iter = ec_dict_iter(dict);
iter != NULL;
iter = ec_dict_iter_next(iter)) {
printf(" %s: %p0,
ec_dict_iter_get_key(iter),
ec_dict_iter_get_val(iter));
}
like, you kick it off with ec_dict_iter(dict), keep going while iter != NULL, and each lap you level up with ec_dict_iter_next(iter). then inside the loop you grab the key with ec_dict_iter_get_key(iter) and the value with ec_dict_iter_get_val(iter). it's giving for-loop but make it slay β
π₯ RETURN VALUE π₯
an iterator element, or NULL if the dict is empty. yeah so if you get NULL back it's not you, it's the dict β there's just nothing in there π
π SEE ALSO π
the whole friend group, go say hi:
ec_dict_has_key(3)ec_dict_free(3)ec_dict_iter_get_val(3)ec_dict_len(3)ec_dict_dup(3)ec_dict_del(3)ec_dict(3)ec_dict_set(3)ec_dict_get(3)ec_dict_dump(3)ec_dict_iter_next(3)ec_dict_iter_get_key(3)
π COPYRIGHT π
Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.
ok that's the whole page bestie, you ate it up, no crumbs left π β¨
and a lil sign-off for the girlies who read to the very end: this one's from libecoli, dated 2026-06-11, and it lives at EC_DICT_ITER(3) in the manual. periodt ππ¦π
π¦ where this page comes from
- fedora 44: libecoli-devel 0.11.7-1.fc44 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- fedora 44: libecoli-devel 0.11.7-1.fc44 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms