EC_EDITLINE_SET_NODE(3)

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

✨ EC_EDITLINE_SET_NODE β€” the libecoli programmer's manual, bestie edition ✨

okay so real talk, this one is from the Libecoli Programmer's Manual, section 3, and it's genuinely so useful once it clicks. let's get into it πŸ’…


πŸŽ€ NAME πŸŽ€

ec_editline_set_node β€” attach an ecoli node to the editline structure. that's it, that's the whole job, and she does it flawlessly fr fr πŸ‘‘


🌸 SYNOPSIS 🌸

#include <ecoli/editline.h>

int ec_editline_set_node(
    struct ec_editline     *editline,  /* The pointer to the ec_editline structure. */
    /*
     * The pointer to the sh_lex ec_node to use as grammar.
     */
    const struct ec_node   *node
);

so you're passing in two things: your editline (pointer to the struct ec_editline) and your node (pointer to the const struct ec_node β€” the sh_lex one you wanna use as grammar). slay. πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• β€” this node must be an sh_lex node, with its grammar subtree and everything. no substitutes, bestie, the vibe check is strict.

what's it even for? it gets used for completion and contextual help. that's the whole glow-up. ✨

and the contextual help description? it's attached as a string to nodes using a node attribute called EC_EDITLINE_HELP_ATTR. literally that's how the help text finds its way home. 🏠


πŸ’€ RETURN VALUE πŸ’€

  • 0 on success β€” we love to see it 🫢
  • -1 on error β€” not the moment, but okay 😭

and when it errors out, errno gets set to EINVAL if the node is not of type sh_lex. so if you fed it the wrong node type, that's your answer. don't say nobody warned you. πŸ™ˆ


🌈 SEE ALSO 🌈

the whole friend group, in order, no one left out:

iykyk πŸ’œ


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

and that's the whole page, bestie!! this lil icon dropped as part of libecoli, dated 2026-06-11, and she's still serving. go attach that node, you absolute main character πŸŽ€βœ¨πŸ’–

πŸ“¦ where this page comes from