MTREE_PARENT(3)

πŸ’– MTREE_PARENT(3) πŸ’–

okay bestie, pull up a chair 🫢 this one lives in the Librecast Programmer's Manual, it's called mtree_parent, and it's literally the shortest glow-up in the whole tree. let's go ✨


🌸 NAME 🌸

mtree_parent β€” return node number of parent node πŸ‘‘


πŸ“š LIBRARY πŸ“š

Librecast library (liblibrecast, -llibrecast) πŸŽ€


✨ SYNOPSIS ✨

#include <librecast/mtree.h>

size_t mtree_parent(size_t node);

Compile and link with -llibrecast.


πŸ¦‹ DESCRIPTION πŸ¦‹

so the mtree_nnode function returns the node number of the parent of node. yes bestie, you read that right, it hands you the parent. no drama, no side quests πŸ’…

this calculation is independent of the tree, and it's implemented as a macro. so it's not out here peeking at your tree structure, it's just doing the math, periodt.

nodes are numbered from 0 = root 🌱


πŸŽ€ RETURN VALUE πŸŽ€

mtree_parent() returns the number of the parent node. that's the whole vibe 🫢


πŸ’€ ERRORS πŸ’€

None. literally none. not a single one. it's giving flawless ✨


πŸ‘‘ SEE ALSO πŸ‘‘


ngl the whole tree is a family and this is just the "go ask your parent" function 🌈

LIBRECAST Β· 2023-07-23 Β· MTREE_PARENT(3) β€” that's the version, the date, and the page name bestie, so you know exactly where this lore came from πŸ’– mwah, go slay your trees 🌸🧚

πŸ“¦ where this page comes from