EC_INTERA..._CALLBACK(3)
π EC_INTERACT_SET_CALLBACK β bestie edition π
okay so real talk, this is page EC_INTERA..._CALLBACK(3) from the Libecoli Programmer's Manual, and it's literally about making your grammar nodes do something when parsing goes right. no cap. let's get into it π«Ά
β¨ NAME β¨
ec_interact_set_callback β set a callback function on a grammar node. that's it, that's the whole vibe π
πΈ 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. */
);
like, you pull in the header, you hand it a node, you hand it a callback, boom. iconic β¨
π¦ DESCRIPTION π¦
So what this does: it sets the node attribute EC_INTERACT_CB_ATTR on the node, and inside that attribute lives a pointer to a function β and that function gets invoked on successful parsing. π
fr fr that's it. you're basically telling the node "hey bestie, when someone parses you correctly, run this". main character energy for your grammar tree π
π RETURN VALUE π
0on success π-1on error π
π SEE ALSO π
the whole friend group, obviously:
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.
and that's the page, bestie!! π this lil slice of the Libecoli Programmer's Manual is dated 2026-06-11, brought to you by libecoli β go forth and callback responsibly π β¨
π¦ where this page comes from
- fedora 44: libecoli-devel 0.11.7-1.fc44 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- fedora 44: libecoli-devel 0.11.7-1.fc44 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms