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:

fr fr, go read them. they're all part of the same little ecosystem and they all slay in their own way πŸ”₯


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