EC_EDITLINE_SET_NODE(3)
β¨ 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 π
0on success β we love to see it π«Ά-1on 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:
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_interact(3)ec_editline_set_history(3)ec_editline(3)ec_editline_get_node(3)ec_editline_curline(3)
iykyk π
π COPYRIGHT π
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
- 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