EC_NODE_MANY(3)

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

✨ EC_NODE_MANY(3) ✨

okay so bestie, welcome to EC_NODE_MANY(3) from the Libecoli Programmer's Manual πŸ’– this is the one where we make a node that just... does the same thing over and over again. iconic behaviour honestly πŸŽ€


🌸 NAME 🌸

ec_node_many β€” bestie, this builds a many node, and a many node is literally a node that matches its child multiple times. that's the whole vibe. no cap. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <ecoli/node_many.h>

struct ec_node * ec_node_many(
    const char       *id,     /* The node identifier. */
    /*
     * The child node. It is consumed and will be freed when the parent is
     * freed, or immediately on error.
     */
    struct ec_node   *child,
    /*
     * Minimum number of repetitions. Use 0 for no minimum.
     */
    unsigned int      min,
    /*
     * Maximum number of repetitions. Use 0 for no maximum.
     */
    unsigned int      max
);

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea on the args, one by one, because we do not skip details in this house 🫢

  • id β€” the node identifier. that's it, that's the whole job πŸŽ€
  • child β€” the child node. important bestie, listen up: it is consumed β€” meaning it gets freed when the parent is freed, or immediately on error. so do not go freeing it yourself afterwards, that's giving double-free energy πŸ’€
  • min β€” minimum number of repetitions. use 0 for no minimum ✨
  • max β€” maximum number of repetitions. use 0 for no maximum ✨

πŸ’… RETURN VALUE πŸ’…

you get the node back 🌈 ... or NULL on error, in which case errno is set. check it, bestie, don't just rawdog the return value 😭


πŸ“ SEE ALSO πŸ“


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


and that's the page!! πŸ¦‹ this was libecoli, dated 2026-06-11, and you absolutely ate it bestie πŸ’– periodt ✨

πŸ“¦ where this page comes from