git.droids-corp.org
/
protos
/
libecoli.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use helper in cmd node
[protos/libecoli.git]
/
lib
/
main-readline.c
diff --git
a/lib/main-readline.c
b/lib/main-readline.c
index
0fb57ab
..
2c81c53
100644
(file)
--- a/
lib/main-readline.c
+++ b/
lib/main-readline.c
@@
-13,7
+13,7
@@
#include <ecoli_init.h>
#include <ecoli_node.h>
#include <ecoli_init.h>
#include <ecoli_node.h>
-#include <ecoli_parse
d
.h>
+#include <ecoli_parse.h>
#include <ecoli_complete.h>
#include <ecoli_keyval.h>
#include <ecoli_node_str.h>
#include <ecoli_complete.h>
#include <ecoli_keyval.h>
#include <ecoli_node_str.h>
@@
-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;
static char *get_node_help(const struct ec_comp_item *item)
{
const struct ec_comp_group *grp;
- const struct ec_parse
d
*state;
+ const struct ec_parse *state;
const struct ec_node *node;
char *help = NULL;
const char *node_help = NULL;
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;
grp = ec_comp_item_get_grp(item);
state = grp->state;
for (state = grp->state; state != NULL;
- state = ec_parse
d
_get_parent(state)) {
- node = ec_parse
d
_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)
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)
{
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;
const struct ec_comp_group *grp, *prev_grp = NULL;
const struct ec_comp_item *item;
- struct ec_comp *c;
- struct ec_parse
d *p
;
+ struct ec_comp *c
= NULL
;
+ struct ec_parse
*p = NULL
;
char *line = NULL;
unsigned int count;
char **helps = 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);
/* check if the current line matches */
p = ec_node_parse(commands, line);
- if (ec_parse
d
_matches(p))
+ if (ec_parse_matches(p))
match = 1;
match = 1;
- ec_parse
d
_free(p);
+ ec_parse_free(p);
p = NULL;
/* complete at current cursor position */
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);
fail:
ec_comp_iter_free(iter);
- ec_parse
d
_free(p);
+ ec_parse_free(p);
free(line);
ec_comp_free(c);
if (helps != NULL) {
free(line);
ec_comp_free(c);
if (helps != NULL) {
@@
-329,7
+329,7
@@
static int create_commands(void)
int main(void)
{
int main(void)
{
- struct ec_parse
d
*p;
+ struct ec_parse *p;
char *line;
if (ec_init() < 0) {
char *line;
if (ec_init() < 0) {
@@
-349,9
+349,9
@@
int main(void)
break;
p = ec_node_parse(commands, line);
break;
p = ec_node_parse(commands, line);
- ec_parse
d
_dump(stdout, p);
+ ec_parse_dump(stdout, p);
add_history(line);
add_history(line);
- ec_parse
d
_free(p);
+ ec_parse_free(p);
}
}