EC_PNODE_DUP(3)
π EC_PNODE_DUP β ok bestie, we're duplicating a whole parsing tree π
so this is a page from the Libecoli Programmer's Manual, and it's about exactly one thing: copying a parsing tree. no cap. one function, zero drama. let's get into it π¦
β¨ NAME β¨
ec_pnode_dup β duplicate a parsing tree.
like, the whole vibe of the tree, cloned. it's giving copy-paste but make it structural π
πΈ SYNOPSIS πΈ
#include <ecoli/parse.h>
struct ec_pnode * ec_pnode_dup(
const struct ec_pnode *pnode /* A node inside a parsing tree. */
);
ok so first you gotta pull in the header, that's non-negotiable:
#include <ecoli/parse.h>
and then the actual call β you hand it pnode, which is a node inside a parsing tree. that comment in the signature is literally the whole description of the argument, so i'm keeping it exactly as it is, periodt. π
π RETURN VALUE π
you get back a pointer to the copy of the input node, and β this is the cute part β it sits at the same place in the copy of the parsing tree. so it's not just a floating node, it's a node with a home in the cloned tree. it's giving main character energy in a whole new tree π³β¨
and if things go sideways? you get NULL on error, and errno is set. classic. check your errno, bestie, don't just stare at the NULL like it's gonna explain itself π
π¦ SEE ALSO π¦
ok this is the friend group. every single one of them, no skipping, iykyk:
ec_pnode_len(3)ec_pnode_get_strvec(3)ec_parse(3)ec_parse_strvec(3)ec_pnode(3)ec_pnode_free_children(3)ec_pnode_get_root(3)ec_pnode_get_parent(3)ec_pnode_find_next(3)ec_pnode_get_first_child(3)ec_pnode_free(3)ec_pnode_matches(3)ec_pnode_dump(3)ec_pnode_unlink_child(3)ec_pnode_next(3)ec_pnode_del_last_child(3)ec_pnode_link_child(3)ec_pnode_count(3)ec_pnode_get_attrs(3)ec_pnode_get_last_child(3)ec_pnode_get_node(3)ec_pnode_find(3)ec_parse_child(3)
fr fr, go read them. they're all part of the same little ecosystem and they all slay in their own way π₯
π COPYRIGHT π
Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.
ngl, this whole page came out of libecoli on 2026-06-11, and yes, the manual name is Libecoli Programmer's Manual because of course it is. stan the docs, bestie. ππΈβ¨
π¦ 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