X-Git-Url: http://git.droids-corp.org/?p=protos%2Flibecoli.git;a=blobdiff_plain;f=src%2Fecoli_node_or.c;fp=src%2Fecoli_node_or.c;h=5f26f62a17a41b02f0a01427a9111e5ac630f5ac;hp=125b70bbc0c003a855c8e4be48414bb90791cc42;hb=984760622f2c8472fd2667e24bcceb543bdb1aff;hpb=ae32f7f2fd1bc44a5388e1984f7c96bc29d3fdc2 diff --git a/src/ecoli_node_or.c b/src/ecoli_node_or.c index 125b70b..5f26f62 100644 --- a/src/ecoli_node_or.c +++ b/src/ecoli_node_or.c @@ -31,7 +31,7 @@ struct ec_node_or { static int ec_node_or_parse(const struct ec_node *node, - struct ec_parse *state, + struct ec_pnode *state, const struct ec_strvec *strvec) { struct ec_node_or *priv = ec_node_priv(node); @@ -39,7 +39,7 @@ ec_node_or_parse(const struct ec_node *node, int ret; for (i = 0; i < priv->len; i++) { - ret = ec_node_parse_child(priv->table[i], state, strvec); + ret = ec_parse_child(priv->table[i], state, strvec); if (ret == EC_PARSE_NOMATCH) continue; return ret; @@ -58,7 +58,7 @@ ec_node_or_complete(const struct ec_node *node, size_t n; for (n = 0; n < priv->len; n++) { - ret = ec_node_complete_child(priv->table[n], + ret = ec_complete_child(priv->table[n], comp, strvec); if (ret < 0) return ret; @@ -238,7 +238,7 @@ struct ec_node *__ec_node_or(const char *id, ...) if (children == NULL) goto fail_free_children; - for (; child != EC_NODE_ENDLIST; child = va_arg(ap, struct ec_node *)) { + for (; child != EC_VA_END; child = va_arg(ap, struct ec_node *)) { if (child == NULL) goto fail_free_children; @@ -264,7 +264,7 @@ struct ec_node *__ec_node_or(const char *id, ...) return node; fail_free_children: - for (; child != EC_NODE_ENDLIST; child = va_arg(ap, struct ec_node *)) + for (; child != EC_VA_END; child = va_arg(ap, struct ec_node *)) ec_node_free(child); fail: ec_node_free(node); /* will also free added children */ @@ -311,26 +311,26 @@ static int ec_node_or_testcase(void) return -1; } testres |= EC_TEST_CHECK_COMPLETE(node, - "", EC_NODE_ENDLIST, - "foo", "bar", "bar2", "toto", "titi", EC_NODE_ENDLIST); + "", EC_VA_END, + "foo", "bar", "bar2", "toto", "titi", EC_VA_END); testres |= EC_TEST_CHECK_COMPLETE(node, - "f", EC_NODE_ENDLIST, - "foo", EC_NODE_ENDLIST); + "f", EC_VA_END, + "foo", EC_VA_END); testres |= EC_TEST_CHECK_COMPLETE(node, - "b", EC_NODE_ENDLIST, - "bar", "bar2", EC_NODE_ENDLIST); + "b", EC_VA_END, + "bar", "bar2", EC_VA_END); testres |= EC_TEST_CHECK_COMPLETE(node, - "bar", EC_NODE_ENDLIST, - "bar", "bar2", EC_NODE_ENDLIST); + "bar", EC_VA_END, + "bar", "bar2", EC_VA_END); testres |= EC_TEST_CHECK_COMPLETE(node, - "t", EC_NODE_ENDLIST, - "toto", "titi", EC_NODE_ENDLIST); + "t", EC_VA_END, + "toto", "titi", EC_VA_END); testres |= EC_TEST_CHECK_COMPLETE(node, - "to", EC_NODE_ENDLIST, - "toto", EC_NODE_ENDLIST); + "to", EC_VA_END, + "toto", EC_VA_END); testres |= EC_TEST_CHECK_COMPLETE(node, - "x", EC_NODE_ENDLIST, - EC_NODE_ENDLIST); + "x", EC_VA_END, + EC_VA_END); ec_node_free(node); return testres;