MDEX_PUT(3)
π MDEX_PUT(3) π
okay bestie, gather round, it's mdex_put from the Librecast Programmer's Manual and she is so much simpler than she looks π«Ά
β¨ NAME β¨
mdex_put β insert an entry into a multicast index π
π LIBRARY π
Librecast library (liblibrecast, -llibrecast) π
π SYNOPSIS π
#include <librecast/mdex.h>
int mdex_put(mdex_t *mdex, unsigned char *hash, size_t hashlen, mdex_entry_t *entry);
Compile and link with -llibrecast. β¨
π¦ DESCRIPTION π¦
so basically? mdex_put takes the value of entry and stores it in the multicast index mdex, using hash (of length hashlen) as the key. like, the hash is the lil name tag and the entry is the whole personality, and they get introduced to each other. π
and here's the iconic part: entry may be NULL, and an entry will still be created. no entry? no problem. the key still gets to exist. main character energy fr fr. π
β RETURN VALUE β
mdex_put() returns zero on success β slay. π
On error, -1 is returned, and errno is set to indicate the error. (yes she's telling on herself, that's the whole point.) π
π ERRORS π
EINVALβ Invalid argument. bestie listen. bothmdexandhashare required (notNULL), andhashlenmust be> 0. no empty vibes allowed, no vibe check passed with a null, none of it. πENOMEMβ Not enough space/cannot allocate memory (POSIX.1-2001). the memory said "not today" and honestly? valid. π
π SEE ALSO π
mdex_init(3), mdex_free(3), mdex_get(3), mdex_del(3), lc_share(3) β the whole friend group, go say hi. π«ΆπΈ
mwah π this page came straight from the Librecast crew, dated 2023-06-20, and yeah β it's page MDEX_PUT(3) of the Librecast Programmer's Manual. that's the whole thing bestie, go put some entries in a multicast index and text me when it works. πβ¨
π¦ where this page comes from
- debian trixie: liblibrecast-dev 0.9.1-1 Β· GPL-2.0-only OR GPL-3.0-only
- nixos 26.05: librecast 0.11.2
- nixpkgs unstable: librecast 0.11.2
- ubuntu noble: liblibrecast-dev 0.8.0-1.1build1 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu questing: liblibrecast-dev 0.9.1-1
- ubuntu resolute: liblibrecast-dev 0.11.2-2 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu stonking: liblibrecast-dev 0.11.2-2build1 Β· GPL-2.0-only OR GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms