EC_YAML_EXPORT(3)

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

✨ EC_YAML_EXPORT(3) ✨

okay bestie, so we're in the Libecoli Programmer's Manual rn and this one is lowkey one of my faves πŸŽ€ it's ec_yaml_export, and she is literally the girl who takes your whole grammar tree and turns it into a YAML glow-up. slay.


πŸ’– NAME πŸ’–

ec_yaml_export β€” export an ec_node tree to a YAML formatted stream. no cap, that's the whole vibe. 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <ecoli/yaml.h>

int ec_yaml_export(
    /*
     * The output stream where YAML content will be written.
     */
    FILE                   *out,
    const struct ec_node   *node   /* The root node of the grammar tree to export. */
);

so you gotta #include <ecoli/yaml.h> first (mandatory, don't skip it, that's the rules πŸ’…), then you pass in your out stream β€” that's the FILE * where all the YAML content gets written ✍️ β€” and your node, which is the const struct ec_node * at the very top of the grammar tree you're exporting. main character node only, she handles the rest. πŸ‘‘


🌈 DESCRIPTION 🌈

This function traverses the ec_node tree and outputs a YAML representation of the grammar structure, including:

  • node type
  • id
  • help
  • attributes
  • configuration

it's giving full documentation energy fr fr 😭✨ and the output can be used as a template or as documentation for grammar definitions. so like, not just pretty β€” she's useful too. ate. πŸ“


πŸ”₯ RETURN VALUE πŸ”₯

  • 0 on success πŸ₯³
  • -1 on error, and errno is set πŸ’€

that's it, that's the deal. check your errno if it goes sideways, bestie.


πŸ‘€ SEE ALSO πŸ‘€


Copyright (C) 2010-2026 Olivier Matz, Robin Jarry. πŸ’œ


libecoli Β· dated 2026-06-11 Β· EC_YAML_EXPORT(3) β€” mwah, go export something iconic bestie 🫢🌈✨

πŸ“¦ where this page comes from