EC_COMP_ADD_ITEM(3)
π EC_COMP_ADD_ITEM(3) π
okay bestie, welcome to the Libecoli Programmer's Manual β today's episode is all about ec_comp_add_item, and honestly? it's giving completion-list royalty β¨
πΈ NAME πΈ
ec_comp_add_item β drop a lil item into the completion list π
β¨ SYNOPSIS β¨
#include <ecoli/complete.h>
struct ec_comp_item * ec_comp_add_item(
struct ec_comp *comp, /* The current completion list. */
const struct ec_node *node, /* The node issuing the completion item. */
enum ec_comp_type type, /* The type of the item. */
const char *current, /* The incomplete string being completed. */
const char *full /* The string fully completed. */
);
π DESCRIPTION π
so basically, this is the function a node calls during the completion process β once for every single completion item that should get added to the list. no cap. the nodes that do this are typically the terminal ones, like ec_node_str() or ec_node_file(). they're the ones on the front lines fr fr π«Ά
what it does: creates a brand new completion item and yeets it straight into the completion list. and every completion item has a type, which can beβ¦ π (scroll down to STRUCTURES bestie, we got you)
π¦ STRUCTURES π¦
the type menu, fresh off the press:
enum ec_comp_type {
EC_COMP_UNKNOWN;
EC_COMP_FULL;
EC_COMP_PARTIAL;
EC_COMP_ALL;
};
π RETURN VALUE π
on success you get back the item that was added to the list. on error? you get NULL. π
do NOT free the returned value, bestie. it's referenced by the completion list, so it's not yours to delete, periodt. π
it gets returned to you anyway, in case you need to modify it β for instance with ec_comp_item_set_display(). iconic behavior tbh.
π SEE ALSO π
the whole friend group, all invited to the group chat:
ec_comp_count(3)ec_comp_item_set_str(3)ec_complete(3)ec_comp_get_attrs(3)ec_comp_group_get_attrs(3)ec_comp_iter_next(3)ec_comp_item_get_node(3)ec_comp_iter_first(3)ec_comp_item_get_current(3)ec_comp_group_get_node(3)ec_complete_strvec_expand(3)ec_comp_free(3)ec_comp_get_cur_pstate(3)ec_complete_unknown(3)ec_complete_strvec(3)ec_comp_item_get_grp(3)ec_comp_item_get_type(3)ec_comp_item_get_str(3)ec_comp_item_set_display(3)ec_complete_child(3)ec_comp(3)ec_comp_item_get_display(3)ec_comp_item_get_completion(3)ec_comp_group_get_pstate(3)ec_comp_dump(3)ec_comp_merge(3)ec_comp_item_set_completion(3)ec_comp_get_cur_group(3)
π COPYRIGHT π
Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.
and that's the whole page, bestie π this lil manual moment comes to you courtesy of libecoli, dated 2026-06-11, and it lives at EC_COMP_ADD_ITEM(3). mwah π go forth and complete some 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