X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fmain-readline.c;h=2c81c53c0f69e76d413910bdc1ede305077844cd;hb=51028779e0a8772091aec5ab96bcf2519cf2f1ad;hp=0fb57ab639ffaf30344dc4baf5e7f12b70254242;hpb=539a859dde94b304e93f44a52b7e7fc0734e3a5d;p=protos%2Flibecoli.git diff --git a/lib/main-readline.c b/lib/main-readline.c index 0fb57ab..2c81c53 100644 --- a/lib/main-readline.c +++ b/lib/main-readline.c @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include @@ -106,7 +106,7 @@ static char **my_attempted_completion(const char *text, int start, int end) static char *get_node_help(const struct ec_comp_item *item) { const struct ec_comp_group *grp; - const struct ec_parsed *state; + const struct ec_parse *state; const struct ec_node *node; char *help = NULL; const char *node_help = NULL; @@ -115,8 +115,8 @@ static char *get_node_help(const struct ec_comp_item *item) grp = ec_comp_item_get_grp(item); state = grp->state; for (state = grp->state; state != NULL; - state = ec_parsed_get_parent(state)) { - node = ec_parsed_get_node(state); + state = ec_parse_get_parent(state)) { + node = ec_parse_get_node(state); if (node_help == NULL) node_help = ec_keyval_get(ec_node_attrs(node), "help"); if (node_desc == NULL) @@ -136,11 +136,11 @@ static char *get_node_help(const struct ec_comp_item *item) static int show_help(int ignore, int invoking_key) { - struct ec_comp_iter *iter; + struct ec_comp_iter *iter = NULL; const struct ec_comp_group *grp, *prev_grp = NULL; const struct ec_comp_item *item; - struct ec_comp *c; - struct ec_parsed *p; + struct ec_comp *c = NULL; + struct ec_parse *p = NULL; char *line = NULL; unsigned int count; char **helps = NULL; @@ -156,9 +156,9 @@ static int show_help(int ignore, int invoking_key) /* check if the current line matches */ p = ec_node_parse(commands, line); - if (ec_parsed_matches(p)) + if (ec_parse_matches(p)) match = 1; - ec_parsed_free(p); + ec_parse_free(p); p = NULL; /* complete at current cursor position */ @@ -212,7 +212,7 @@ static int show_help(int ignore, int invoking_key) fail: ec_comp_iter_free(iter); - ec_parsed_free(p); + ec_parse_free(p); free(line); ec_comp_free(c); if (helps != NULL) { @@ -329,7 +329,7 @@ static int create_commands(void) int main(void) { - struct ec_parsed *p; + struct ec_parse *p; char *line; if (ec_init() < 0) { @@ -349,9 +349,9 @@ int main(void) break; p = ec_node_parse(commands, line); - ec_parsed_dump(stdout, p); + ec_parse_dump(stdout, p); add_history(line); - ec_parsed_free(p); + ec_parse_free(p); }