EC_DICT_GET(3)
β¨ EC_DICT_GET(3) β¨
okay bestie, welcome to libecoli's programmer's manual, and today's main character is ec_dict_get π
she's from the Libecoli Programmer's Manual</...> β no wait, keep it cute: she lives in the Libecoli programmer's manual, page EC_DICT_GET(3), and she has ONE job and she does it gorgeously.
πΈ NAME πΈ
ec_dict_get β bestie, she gets a value from the hash table. that's it. that's the whole gig. and she eats every time π
π¦ SYNOPSIS π¦
#include <ecoli/dict.h>
void * ec_dict_get(
const struct ec_dict *dict, /* The hash table. */
const char *key /* The key string. Must not be NULL. */
);
so you're handing her a pointer to the hash table β that's the dict, const struct ec_dict *, she's not gonna mess with it, she's just looking π β and then a key string, const char *, and heads up queen, that key must NOT be NULL. like, non-negotiable. she's giving you a void * back, so whatever you stored in there, that's your problem now π
β RETURN VALUE β
- if she finds your element? you get the element back. slay. that's the dream.
- if something goes wrong? you get
NULL, anderrnois set. the vibe check failed, unfortunately π - plot twist though: if it's actually a success but the element itself happens to be
NULL, thenerrnogets set to0. so like...NULLbut make it successful. iykyk. don't get it twisted β¨ - and if
keyisNULL?errnois set toEINVAL. we told you, bestie. the key cannot beNULL. that's the rule π
π SEE ALSO π
she does not run this town alone, she has a whole friend group and you should meet all of them fr fr:
ec_dict_iter(3)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_dump(3)ec_dict_iter_next(3)ec_dict_iter_get_key(3)
go read them. all of them. no skimming π
π COPYRIGHT π
Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.
and that's the whole page, periodt π this was libecoli, version dated 2026-06-11, and honestly? iconic. go get your values, bestie π«Άπ§
π¦ 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