EC_INTERACT_SET_CALLBACK(3)

NAME
ec_interact_set_callback - Set callback function on a grammar node.

SYNOPSIS
#include <ecoli/interact.h>

int ec_interact_set_callback(
    /*
     * The ec_node on which to add the callback attribute.
     */
    struct ec_node           *node,
    ec_interact_command_cb_t  cb     /* The callback function pointer. */
);

DESCRIPTION

Set the node attribute EC_INTERACT_CB_ATTR on the node, containing the pointer to a function invoked on successful parsing.

RETURN VALUE

0 on success, or -1 on error.

SEE ALSO

ec_interact_get_completions(3), ec_interact_print_helps(3), ec_interact_print_error_helps(3), ec_interact_print_cols(3), ec_interact_set_help(3), ec_interact_append_chars(3), ec_interact_set_desc(3), ec_interact_get_callback(3), ec_interact_get_error_helps(3), ec_interact_free_completions(3), ec_interact_get_helps(3), ec_interact_free_helps(3)

COPYRIGHT

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