EC_EDITLINE_SET_NODE(3)

NAME
ec_editline_set_node - Attach an ecoli node to the editline structure.

SYNOPSIS
#include <ecoli/editline.h>

int ec_editline_set_node(
    struct ec_editline     *editline,  /* The pointer to the ec_editline structure. */
    /*
     * The pointer to the sh_lex ec_node to use as grammar.
     */
    const struct ec_node   *node
);

DESCRIPTION

This node must be an sh_lex node, with its grammar subtree. It will be used for completion and contextual help. The contextual help description is attached as a string to nodes using a node attribute EC_EDITLINE_HELP_ATTR.

RETURN VALUE

0 on success, or -1 on error. errno is set to EINVAL if the node is not of type sh_lex.

SEE ALSO

ec_editline_get_el(3), ec_editline_set_prompt(3), ec_editline_complete(3), ec_editline_set_prompt_esc(3), ec_editline_parse(3), ec_editline_free(3), ec_editline_term_size(3), ec_editline_gets(3), ec_editline_interact(3), ec_editline_set_history(3), ec_editline(3), ec_editline_get_node(3), ec_editline_curline(3)

COPYRIGHT

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