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
rename structures and functions
[protos/libecoli.git]
/
examples
/
parse-yaml
/
parse-yaml.c
diff --git
a/examples/parse-yaml/parse-yaml.c
b/examples/parse-yaml/parse-yaml.c
index
4f46b22
..
d1c1a54
100644
(file)
--- a/
examples/parse-yaml/parse-yaml.c
+++ b/
examples/parse-yaml/parse-yaml.c
@@
-108,10
+108,10
@@
static int parse_args(int argc, char **argv)
}
static int
}
static int
-__dump_as_shell(FILE *f, const struct ec_p
ars
e *parse, size_t *seq)
+__dump_as_shell(FILE *f, const struct ec_p
nod
e *parse, size_t *seq)
{
{
- const struct ec_node *node = ec_p
ars
e_get_node(parse);
- struct ec_p
ars
e *child;
+ const struct ec_node *node = ec_p
nod
e_get_node(parse);
+ struct ec_p
nod
e *child;
size_t cur_seq, i, len;
const char *s;
size_t cur_seq, i, len;
const char *s;
@@
-125,25
+125,25
@@
__dump_as_shell(FILE *f, const struct ec_parse *parse, size_t *seq)
fprintf(f, "ec_node%zu_type='%s'\n", cur_seq,
ec_node_type_name(ec_node_type(node)));
fprintf(f, "ec_node%zu_type='%s'\n", cur_seq,
ec_node_type_name(ec_node_type(node)));
- len = ec_strvec_len(ec_p
ars
e_strvec(parse));
+ len = ec_strvec_len(ec_p
nod
e_strvec(parse));
fprintf(f, "ec_node%zu_strvec_len=%zu\n", cur_seq, len);
for (i = 0; i < len; i++) {
fprintf(f, "ec_node%zu_strvec_len=%zu\n", cur_seq, len);
for (i = 0; i < len; i++) {
- s = ec_strvec_val(ec_p
ars
e_strvec(parse), i);
+ s = ec_strvec_val(ec_p
nod
e_strvec(parse), i);
fprintf(f, "ec_node%zu_str%zu='%s'\n", cur_seq, i, s);
}
fprintf(f, "ec_node%zu_str%zu='%s'\n", cur_seq, i, s);
}
- if (ec_p
ars
e_get_first_child(parse) != NULL) {
+ if (ec_p
nod
e_get_first_child(parse) != NULL) {
fprintf(f, "ec_node%zu_first_child='ec_node%zu'\n",
cur_seq, cur_seq + 1);
}
fprintf(f, "ec_node%zu_first_child='ec_node%zu'\n",
cur_seq, cur_seq + 1);
}
- EC_P
ARS
E_FOREACH_CHILD(child, parse) {
+ EC_P
NOD
E_FOREACH_CHILD(child, parse) {
fprintf(f, "ec_node%zu_parent='ec_node%zu'\n",
*seq + 1, cur_seq);
__dump_as_shell(f, child, seq);
}
fprintf(f, "ec_node%zu_parent='ec_node%zu'\n",
*seq + 1, cur_seq);
__dump_as_shell(f, child, seq);
}
- if (ec_p
ars
e_next(parse) != NULL) {
+ if (ec_p
nod
e_next(parse) != NULL) {
fprintf(f, "ec_node%zu_next='ec_node%zu'\n",
cur_seq, *seq + 1);
}
fprintf(f, "ec_node%zu_next='ec_node%zu'\n",
cur_seq, *seq + 1);
}
@@
-152,7
+152,7
@@
__dump_as_shell(FILE *f, const struct ec_parse *parse, size_t *seq)
}
static int
}
static int
-dump_as_shell(const struct ec_p
ars
e *parse)
+dump_as_shell(const struct ec_p
nod
e *parse)
{
FILE *f;
size_t seq = 0;
{
FILE *f;
size_t seq = 0;
@@
-173,7
+173,7
@@
static int
interact(struct ec_node *node)
{
struct ec_editline *editline = NULL;
interact(struct ec_node *node)
{
struct ec_editline *editline = NULL;
- struct ec_p
ars
e *parse = NULL;
+ struct ec_p
nod
e *parse = NULL;
struct ec_node *shlex = NULL;
char *line = NULL;
struct ec_node *shlex = NULL;
char *line = NULL;
@@
-193,23
+193,23
@@
interact(struct ec_node *node)
if (parse == NULL)
goto fail;
if (parse == NULL)
goto fail;
- if (!ec_p
ars
e_matches(parse))
+ if (!ec_p
nod
e_matches(parse))
goto fail;
goto fail;
- //ec_p
ars
e_dump(stdout, parse);
+ //ec_p
nod
e_dump(stdout, parse);
if (dump_as_shell(parse) < 0) {
fprintf(stderr, "Failed to dump the parsed result\n");
goto fail;
}
if (dump_as_shell(parse) < 0) {
fprintf(stderr, "Failed to dump the parsed result\n");
goto fail;
}
- ec_p
ars
e_free(parse);
+ ec_p
nod
e_free(parse);
ec_editline_free(editline);
ec_node_free(shlex);
return 0;
fail:
ec_editline_free(editline);
ec_node_free(shlex);
return 0;
fail:
- ec_p
ars
e_free(parse);
+ ec_p
nod
e_free(parse);
ec_editline_free(editline);
free(line);
ec_node_free(shlex);
ec_editline_free(editline);
free(line);
ec_node_free(shlex);
@@
-232,7
+232,7
@@
complete_words(const struct ec_node *node, int argc, char *argv[])
if (strvec == NULL)
goto fail;
if (strvec == NULL)
goto fail;
- comp = ec_
node_
complete_strvec(node, strvec);
+ comp = ec_complete_strvec(node, strvec);
if (comp == NULL)
goto fail;
if (comp == NULL)
goto fail;