EC_PNODE_FIND_NEXT(3)

✨ EC_PNODE_FIND_NEXT(3) ✨

okay bestie, so this one lives in the Libecoli Programmer's Manual and it's literally the "and what's NEXT" of node-finding πŸ’…


🌸 NAME 🌸

ec_pnode_find_next β€” find the next node matching an identifier. yes, the next one. the sequel. the part two. 🎬


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <ecoli/parse.h>

const struct ec_pnode * ec_pnode_find_next(
    /*
     * The root of the search, as passed to ec_pnode_find().
     */
    const struct ec_pnode   *root,
    const struct ec_pnode   *prev,           /* The node returned by the previous search. */
    const char              *id,             /* The node identifier string to match. */
    /*
     * True to iterate the children of "prev", false to skip them.
     */
    bool                     iter_children
);

πŸ’– DESCRIPTION πŸ’–

so after you've had a successful call to ec_pnode_find() or ec_pnode_find_next() (key word: successful, no cap), you can go grab the next node that has the id you're matching on. slay.

there are 2 options for how you wanna do that:

  • continue the depth-first search where it was interrupted πŸ”
  • skip the children of the current node, and continue the depth-first search 🫢

that's it. that's the whole vibe. you're either picking up right where you left off, or you're ghosting the children and moving on. main character energy fr fr.


🌈 RETURN VALUE 🌈

the next node matching the identifier, or NULL if it's not found 😭 (not me getting ghosted by a node).


πŸŽ€ SEE ALSO πŸŽ€

the whole friend group, obviously πŸ’œ


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


ok and that's the tea πŸ“ this lil page came out of libecoli on 2026-06-11, and honestly? iconic. go find ur next node bestie, i believe in u πŸ’–βœ¨πŸ¦‹
πŸ“¦ where this page comes from