MTREE_NNODE(3)

MTREE_NNODE(3) πŸ’…

okay bestie, welcome to the Librecast Programmer's Manual β€” this one lives in section 3 and it's lowkey the chillest lil function in the whole tree 🌳✨


NAME πŸŽ€

mtree_nnode β€” gimme a pointer to an mtree node, bestie

LIBRARY πŸ“š

Librecast library (liblibrecast, -llibrecast) πŸ¦‹

SYNOPSIS ✨

#include <librecast/mtree.h>

uint8_t *mtree_nnode(mtree_t *tree, size_t node);

Compile and link with -llibrecast. πŸ”—

DESCRIPTION 🌸

so the way that mtree_nnode works is it hands you back a pointer to the hash of node node, where 0 = root. that's it. that's the whole vibe. number zero is the root, no cap. πŸ‘‘

RETURN VALUE πŸ’–

mtree_nnode() returns a pointer to the hash of the numbered node. 🫢

but if something goes wrong, it returns NULL, and errno gets set to tell you what went wrong. so check that pointer, bestie, fr fr. 😭

ERRORS πŸ’€

  • ERANGE β€” the node you asked for is out of range for tree. it's giving "bestie that node does not exist". 🚫

SEE ALSO πŸ”₯

mtree_init(3), mtree_free(3), mtree_build(3)


and that's the whole page, periodt πŸ’… LIBRECAST put this one out on 2023-06-20, and it's filed under MTREE_NNODE(3) β€” go build something iconic with it, mwah πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from