enum ec_completed_type {
EC_NO_MATCH,
EC_MATCH,
- EC_PARTIAL,
+ EC_PARTIAL_MATCH,
};
struct ec_completed_match {
const struct ec_node *node;
char *add;
- /* reverse order: [0] = last parsed, [len-1] = root */
+ /* reverse order: [0] = last, [len-1] = root */
const struct ec_node **path;
size_t pathlen;
};
struct ec_completed {
unsigned count;
unsigned count_match;
- char *smallest_start;
struct ec_completed_node_list nodes;
};
int ec_completed_add_match(struct ec_completed *completed,
struct ec_parsed *state,
const struct ec_node *node, const char *add);
-int ec_completed_add_node(struct ec_completed *completed,
+int ec_completed_add_no_match(struct ec_completed *completed,
+ struct ec_parsed *parsed_state,
const struct ec_node *node);
-int ec_completed_add_partial(struct ec_completed *completed,
+int ec_completed_add_partial_match(struct ec_completed *completed,
struct ec_parsed *state, const struct ec_node *node,
const char *add);
+int ec_completed_add_node(struct ec_completed *completed,
+ const struct ec_node *node);
+
void ec_completed_match_free(struct ec_completed_match *item);
void ec_completed_free(struct ec_completed *completed);
void ec_completed_dump(FILE *out,
struct ec_parsed *state,
const struct ec_strvec *strvec);
-/* cannot return NULL */
-const char *ec_completed_smallest_start(
- const struct ec_completed *completed);
+/* return the smallest string start, or NULL on error */
+char *ec_completed_smallest_start(const struct ec_completed *completed);
unsigned int ec_completed_count(
const struct ec_completed *completed,