MDEX_INIT(3)
π mdex_init(3) β Librecast Programmer's Manual π
okay bestie, welcome to the mdex_init page, straight outta the Librecast Programmer's Manual β¨ this is where we spin up (and tear down) a multicast index, and honestly? it's giving low-level elegance. let's get into it π«Ά
πΈ NAME πΈ
mdex_init, mtree_free β initialize and free a multicast index
(no fr, that's what the NAME line says, mtree_free and all β we keep the lore exact π
)
π LIBRARY π
Librecast library (liblibrecast, -llibrecast)
β¨ SYNOPSIS β¨
#include <librecast/mdex.h>
mdex_t *mdex_init(size_t entries);
void mdex_free(mdex_t *mdex);
Compile and link with -llibrecast.
π¦ DESCRIPTION π¦
So, the mdex_init function initializes a multicast index. That's it, that's the whole vibe β it sets the thing up so you can use it π
The entries argument gives the initial number of entries to allocate. And listen, bestie, this is just a hint for initial memory allocation β the index will be resized as required. So don't stress about getting the number perfect, it's not that deep, the index grows on its own π±
π« RETURN VALUE π«
mdex_init() returns a pointer to a mdex_t handle. That pointer is your new bestie and it should be freed by passing it to mdex_free() when you're done with it β no leaving it hanging, that's rude π
On error, NULL is returned, and errno is set to indicate the error.
The mdex_free() function returns no value, and preserves errno. Iconic behaviour, honestly β it cleans up after itself and doesn't mess with your errno. periodt π
π ERRORS π
ENOMEMβ Not enough space/cannot allocate memory (POSIX.1-2001).
bestie if you see this one, your memory said "not today" π there is genuinely no room, it's not a you problem, it's a system problem.
π SEE ALSO π
mdex_get(3), mdex_put(3), mdex_del(3)
like, go read those next, they're the rest of the squad fr fr π
mwah π that's the whole page. this one shipped from LIBRECAST, dated 2023-06-20, and it lives under the title MDEX_INIT(3) β go forth and initialize your multicast indexes, main character πβ¨
π¦ 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