EC_NODE_CHECK_TYPE(3)

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

πŸ’– EC_NODE_CHECK_TYPE β€” it's giving "is this node THAT girl?" πŸ’–

okay bestie, welcome to Libecoli Programmer's Manual section 3, where we answer the one question every grammar node has to face at some point: are you actually the type you say you are? ✨


πŸŽ€ NAME πŸŽ€

ec_node_check_type β€” literally just check the type of a node. that's it. that's the job. πŸ’…


🌸 SYNOPSIS 🌸

#include <ecoli/node.h>

int ec_node_check_type(
    const struct ec_node        *node,  /* The grammar node. */
    const struct ec_node_type   *type   /* The pointer to the type structure. */
);

so you roll up with a node and a type pointer, and it tells you if they match. main character energy honestly. πŸ¦‹


🧚 STRUCTURES 🧚

so there's a structure that describes a grammar node type, and it's usually defined as a static const structure in the code that defines a new grammar node type. if you wanna see real examples, go peek in the ecoli_node_<type>.c files β€” they're the blueprint besties. πŸ‘‘

struct ec_node_type {
};

that's the whole thing, no cap. yes it's empty here, that's just how the page shows it. πŸ™ˆ


⭐ RETURN VALUE ⭐

  • 0 β€” slay, the node is of the specified type. πŸ’–
  • -1 β€” nope, not that type. πŸ’€

periodt.


πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group, fr fr:


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


and that's the vibe check, bestie β€” this page came from libecoli and it's dated 2026-06-11. go forth and check those types. πŸ’œπŸ«Ά

πŸ“¦ where this page comes from