EC_NODE_GET_CHILD(3)
π 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 π«Ά
0on success β slay, you got your child π-1on error β not slay, something went sideways π
periodt.
π SEE ALSO π
the whole friend group, in the order they were introduced:
ec_node_check_type(3)ec_node_iter(3)ec_node_attrs(3)ec_node_find(3)ec_node_type_name(3)ec_node_free(3)ec_node_id(3)ec_node_type_dump(3)ec_node_get_config(3)ec_node_schema_dump(3)ec_node_priv(3)ec_node_type_lookup(3)ec_node_clone(3)ec_node_dump(3)ec_node_desc(3)ec_node_iter_free(3)ec_node_iter_get_parent(3)ec_node_from_type(3)ec_node_type(3)ec_node_iter_next(3)ec_node_type_schema(3)ec_node(3)ec_node_get_children_count(3)ec_node_get_type_name(3)ec_node_type_register(3)ec_node_set_config(3)ec_node_iter_get_node(3)
π COPYRIGHT π
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
- fedora 44: libecoli-devel 0.11.7-1.fc44 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- fedora 44: libecoli-devel 0.11.7-1.fc44 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms