EC_HTABLE_SET(3)
π EC_HTABLE_SET π
okay so bestie, welcome to the Libecoli Programmer's Manual β¨ this is the page for ec_htable_set(3) and honestly? she's a baddie. she puts stuff in your hash table. that's it. that's the job. π
πΈ NAME πΈ
ec_htable_set β add or replace an object in the hash table. literally just drop it in there π
β¨ SYNOPSIS β¨
#include <ecoli/htable.h>
int ec_htable_set(
struct ec_htable *htable, /* The hash table. */
const void *key, /* The key. */
size_t key_len, /* The key length. */
void *val, /* The pointer to be saved in the hash table. */
/*
* An optional pointer to a destructor function called when an object is
* destroyed (ec_htable_del() or ec_htable_free()).
*/
ec_htable_elt_free_t free_cb
);
no cap, that's the whole vibe. you hand her the table, the key, how long that key is, the pointer you wanna stash, and a lil cleanup callback. π
π₯ RETURN VALUE π₯
0on success β slay, it worked, main character energy π-1on error, anderrnogets set so you can go find out what went wrong π
β οΈ okay this part matters fr fr: on error, the value you passed in is freed β as infree_cb(val)gets called. so do NOT go touching that pointer after a-1, she's gone, she's in her deleted era π
π¦ SEE ALSO π¦
the whole friend group, go say hi:
ec_htable_iter_get_key(3)ec_htable_iter_get_val(3)ec_htable_iter_next(3)ec_htable_has_key(3)ec_htable_len(3)ec_htable(3)ec_htable_force_seed(3)ec_htable_dup(3)ec_htable_iter_get_key_len(3)ec_htable_dump(3)ec_htable_del(3)ec_htable_get(3)ec_htable_free(3)ec_htable_iter(3)
π COPYRIGHT π
Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.
and that's the page bestie, iykyk π«Ά this was libecoli, dated 2026-06-11, and the page is EC_HTABLE_SET(3) β obsessed with her honestly, go set some keys πβ¨πΈ
π¦ 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