EC_EDITLINE_CURLINE(3)
π EC_EDITLINE_CURLINE π
okay bestie, so this one is from the Libecoli Programmer's Manual and it's literally just about grabbing the line you're currently editing. one function, tiny page, big slay. β¨
π NAME π
ec_editline_curline β get the current edited line, periodt. π
β¨ SYNOPSIS β¨
#include <ecoli/editline.h>
char * ec_editline_curline(
const struct ec_editline *editline, /* The pointer to the ec_editline structure. */
/*
* If true, remove all characters starting from cursor (included).
*/
bool trim_after_cursor
);
so you pull in <ecoli/editline.h> first, obviously, and then it's giving two args, no cap:
editlineβ the pointer to thestruct ec_editline. that's your girl, your main character struct. πtrim_after_cursorβ abool, and the source comment says it all fr fr: if true, remove all characters starting from cursor (included). so cursor and everything after it? gone. bye. π
and the return type is char *, so it's handing you a string, we love that for us. π¦
πΈ RETURN VALUE πΈ
you get back an allocated string holding the current line. iconic. but listen β it must be freed by the user. that's on you, bestie, not on the library. π«Ά
and if something goes wrong? it returns NULL on error. π
no cap: if you forget to free() that string you are lowkey leaking memory and the vibe check will NOT be passed. π
π SEE ALSO π
the whole friend group, go say hi:
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_node(3)ec_editline_set_history(3)ec_editline(3)ec_editline_get_node(3)
π COPYRIGHT π
Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.
and that's the whole page, bestie β libecoli, dated 2026-06-11, and yeah, that EC_EDITLINE_CURLINE(3) header up top is just the vibe check saying hi. mwah, go free your strings πβ¨
π¦ 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