Libecoli  0.11.3
Extensible COmmand LIne library
Functions
YAML import/export

Functions

struct ec_nodeec_yaml_import (const char *filename)
 
int ec_yaml_export (FILE *out, const struct ec_node *node)
 

Detailed Description

Interface to import/export ecoli data structures in YAML.

Function Documentation

◆ ec_yaml_import()

struct ec_node* ec_yaml_import ( const char *  filename)

Parse a YAML file and build an ec_node tree from it.

Parameters
filenameThe path to the file to be parsed.
Returns
The ec_node tree on success, or NULL on error (errno is set). The returned node must be freed by the caller with ec_node_free().
Examples
parse-yaml/parse-yaml.c.

◆ ec_yaml_export()

int ec_yaml_export ( FILE *  out,
const struct ec_node node 
)

Export an ec_node tree to a YAML formatted stream.

This function traverses the ec_node tree and outputs a YAML representation of the grammar structure including node type, id, help, attributes and configuration. The output can be used as a template or documentation for grammar definitions.

Parameters
outThe output stream where YAML content will be written.
nodeThe root node of the grammar tree to export.
Returns
0 on success, or -1 on error (errno is set).