return compnode;
}
-static struct ec_completed_match *
-ec_completed_match(enum ec_completed_type type, struct ec_parsed *state,
+static struct ec_completed_item *
+ec_completed_item(enum ec_completed_type type, struct ec_parsed *state,
const struct ec_node *node, const char *add)
{
- struct ec_completed_match *item = NULL;
+ struct ec_completed_item *item = NULL;
struct ec_parsed *p;
size_t len;
ec_free(item->path);
ec_free(item->add);
}
- ec_completed_match_free(item);
+ ec_completed_item_free(item);
return NULL;
}
const struct ec_node *node, const char *add)
{
struct ec_completed_node *compnode = NULL;
- struct ec_completed_match *match = NULL;
+ struct ec_completed_item *match = NULL;
int ret = -ENOMEM;
/* find the compnode entry corresponding to this node */
if (compnode == NULL)
return -ENOENT;
- match = ec_completed_match(type, parsed_state, node, add);
+ match = ec_completed_item(type, parsed_state, node, add);
if (match == NULL)
goto fail;
return 0;
fail:
- ec_completed_match_free(match);
+ ec_completed_item_free(match);
return ret;
}
return 0;
}
-void ec_completed_match_free(struct ec_completed_match *match)
+void ec_completed_item_free(struct ec_completed_item *match)
{
ec_free(match->add);
ec_free(match->path);
void ec_completed_free(struct ec_completed *completed)
{
struct ec_completed_node *compnode;
- struct ec_completed_match *item;
+ struct ec_completed_item *item;
if (completed == NULL)
return;
while (!TAILQ_EMPTY(&compnode->matches)) {
item = TAILQ_FIRST(&compnode->matches);
TAILQ_REMOVE(&compnode->matches, item, next);
- ec_completed_match_free(item);
+ ec_completed_item_free(item);
}
ec_free(compnode);
}
void ec_completed_dump(FILE *out, const struct ec_completed *completed)
{
struct ec_completed_node *compnode;
- struct ec_completed_match *item;
+ struct ec_completed_item *item;
if (completed == NULL || completed->count == 0) {
fprintf(out, "no completion\n");
char *ec_completed_smallest_start(const struct ec_completed *completed)
{
struct ec_completed_node *compnode;
- struct ec_completed_match *item;
+ struct ec_completed_item *item;
char *smallest_start = NULL;
size_t n;
return iter;
}
-const struct ec_completed_match *ec_completed_iter_next(
+const struct ec_completed_item *ec_completed_iter_next(
struct ec_completed_iter *iter)
{
const struct ec_completed *completed = iter->completed;
const struct ec_completed_node *cur_node;
- const struct ec_completed_match *cur_match;
+ const struct ec_completed_item *cur_match;
if (completed == NULL)
return NULL;