EC_EDITLINE_INTERACT(3)
β¨ EC_EDITLINE_INTERACT(3) β¨
okay bestie, so this one's from the Libecoli Programmer's Manual, and it's genuinely the moment your lil command line finally starts talking back π¬π
π NAME π
ec_editline_interact β hang out with the user until they dip. that's it, that's the whole vibe. no cap.
πΈ 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 π¦
so basically, this function runs the command line for you π it parses and completes commands on demand β like, whenever, no stress, main character energy fr.
the way that when a command gets parsed successfully, it goes and invokes the callback that's attached to the grammar node as an EC_INTERACT_CB_ATTR attribute π and heads up: that callback type must be ec_interact_command_cb_t. no substitutions bestie, it's giving strict.
on EOF, or if the check_exit() function returns true, it dips out of the interactive loop πͺβ¨ iconic exit, honestly.
lowkey important: thatcheck_exit_cbis optional and it fires before each loop iteration to check if the loop should be exited (when the function returnstrue). andopaqueis your user pointer, passed as-is tocheck_exit_cb(). no touching, no transforming, it just goes straight through π«Ά
π RETURN VALUE π
0β the interactive loop exited gracefully π all good, we're slaying-1β error π something went wrong
π SEE ALSO π
your required reading, bestie, go be nosy πβ¨
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)
π COPYRIGHT π
Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.
and that's the whole page bestie, tysm for reading π₯Ήπ this was libecoli, dated 2026-06-11, page EC_EDITLINE_INTERACT(3) β go forth and interact β¨πΈπ¦
π¦ 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