EC_NODE_GET_CHILD(3)

πŸ“¦
version 0.11.7 Β· 4 versions
, in fedora 44

πŸ’– ec_node_get_child β€” bestie's guide to snatching the n-th child πŸ’–

okay so this is from the Libecoli Programmer's Manual (that's the <ecoli/node.h> crew, EC_NODE_GET_CHILD(3) for the searchable girlies) and it does exactly one thing but it does it flawlessly: it gets you the n-th child of a node. that's it. that's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

first, the include, no skipping:

#include <ecoli/node.h>

then the function itself, exactly as written, comments and all, because I love you and I want you to have the full picture:

int ec_node_get_child(
    const struct ec_node   *node,   /* The grammar node. */
    /*
     * The index of the child node, that must be lower than the number of
     * children.
     */
    size_t                  i,
    /*
     * The pointer where the child node pointer will be stored on success.
     */
    struct ec_node        **child
);

so like. you hand it a node, you hand it an index, you hand it a place to put the answer. the index? it MUST be lower than the number of children, okay? that's not a suggestion bestie, that's the rule. πŸ™ˆ


🫢 RETURN VALUE 🫢

  • 0 on success β€” slay, you got your child πŸ’…
  • -1 on error β€” not slay, something went sideways 😭

periodt.


🌈 SEE ALSO 🌈

the whole friend group, in the order they were introduced:


Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.


okay that's the whole page, you ate it, go get those children bestie πŸ’œπŸ¦‹βœ¨

this little treasure came out of libecoli on 2026-06-11, filed under EC_NODE_GET_CHILD(3) β€” mwah, no notes πŸ’‹

πŸ“¦ where this page comes from