ec_comp_add_item - Man Page

Add an item in 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

This function can be called by a node during the completion process, for each completion item that should be added to the list. This is typically done in terminal nodes, like ec_node_str() or ec_node_file().

Create a new completion item, and add it into the completion list. A completion item has a type, which can be:

Structures

enum ec_comp_type {


      EC_COMP_UNKNOWN;

      EC_COMP_FULL;

      EC_COMP_PARTIAL;

      EC_COMP_ALL;
};

Return Value

The item that was added in the list on success, or NULL on error. Note: do not free the returned value, as it is referenced by the completion list. It is returned in case it needs to be modified, for instance with ec_comp_item_set_display().

See Also

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)

Referenced By

ec_comp(3), ec_comp_count(3), ec_comp_dump(3), ec_comp_free(3), ec_comp_get_attrs(3), ec_comp_get_cur_group(3), ec_comp_get_cur_pstate(3), ec_comp_group_get_attrs(3), ec_comp_group_get_node(3), ec_comp_group_get_pstate(3), ec_comp_item_get_completion(3), ec_comp_item_get_current(3), ec_comp_item_get_display(3), ec_comp_item_get_grp(3), ec_comp_item_get_node(3), ec_comp_item_get_str(3), ec_comp_item_get_type(3), ec_comp_item_set_completion(3), ec_comp_item_set_display(3), ec_comp_item_set_str(3), ec_comp_iter_first(3), ec_comp_iter_next(3), ec_complete(3), ec_complete_child(3), ec_complete_strvec(3), ec_complete_strvec_expand(3), ec_complete_unknown(3), ec_comp_merge(3).

2026-06-11 Libecoli Programmer's Manual