ec_editline_interact - Man Page

Synopsis

#include <ecoli/editline.h>

int ec_editline_interact(
    struct ec_editline          *editline,       /* The pointer to the ec_editline structure. */
    /*
     * Optional function pointer executed before each loop iteration to check
     * if loop should be exited (when the function return true).
     */
    ec_editline_check_exit_cb_t  check_exit_cb,
    void                        *opaque          /* User pointer, passed as-is to check_exit_cb(). */
);

Description

Interact with the user until exit.

Run the command line, parsing and completing commands on demand. When a command is parsed successfully, invoke the callback attached to the grammar node as a EC_INTERACT_CB_ATTR attribute. The callback type must be ec_interact_command_cb_t.

On EOF, or if check_exit() function returns true, exit from the interactive loop.

Return Value

0 if interactive loop exited gracefully, or -1 on error.

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_set_node(3), ec_editline_set_history(3), ec_editline(3), ec_editline_get_node(3), ec_editline_curline(3)

Referenced By

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

2026-05-21 Libecoli Programmer's Manual