EC_EDITLINE_INTERACT(3)

πŸ“¦
version 0.11.7 Β· 5 versions
, in fedora 44

✨ 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: that check_exit_cb is optional and it fires before each loop iteration to check if the loop should be exited (when the function returns true). and opaque is your user pointer, passed as-is to check_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 πŸ‘€βœ¨


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